toronto user groups workshop - 2013-03-10 - html5 & windows 8, friends with benefits

53
HTML5 & Windows 8 friends with benefits Frédéric Harper Technical Evangelist @ Microsoft Canada @fharper | outofcomfortzone.net 2013-03- 10

Post on 18-Oct-2014

537 views

Category:

Technology


2 download

DESCRIPTION

What would you say if I told you that you can use your actual HTML, CSS, and JavaScript skills to create an amazing Windows 8 application? That all the lovely features that you like so much about HTML5, can be used to create your next masterpiece? That you can use the magical JavaScript libraries you use everyday to get in the game more quickly? Be honest, you would say that I'm crazy... Maybe, or maybe not, only the attendees to this session will know!

TRANSCRIPT

Page 1: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

HTML5 & Windows 8friends with benefits

Frédéric HarperTechnical Evangelist @ Microsoft Canada

@fharper | outofcomfortzone.net

2013-03-10

Page 2: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

WINDOWS 8

Page 3: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Windows reimaginedNew fast and fluid Start screen

Everything great about Windows 7 we made even better

Touch, mouse, keyboard

Page 4: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Great experience across all hardwareTablets to

laptops to all-in-ones

Highest power to the most efficient chipset

Touch, mouse, keyboard

Page 5: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Content Before Chrome

Content comes first. Immerse users in the things they love

Leave only the most relevant elements on screen to minimize distractions

Page 6: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

If you know web technologies, you are ready to build amazing apps for

the Windows Store

Page 7: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Windows Core OS Services

JavaScript(Chakra)

CC++

C#VB

Windows 8 Store Apps

Communication

& Data

Application Model

Devices & Printing

WinRT APIsGraphics &

Media

XAML HTML / CSS

HTMLJavaScrip

tCSS

CC++

C#VB

Desktop Apps

Win32

.NET / SL

Internet Explore

r

Syst

em

Serv

ices

Vie

wM

od

el

Contr

olle

rC

ore Windows Core OS Services

Communication

& Data

Application Model

Devices & Printing

Graphics & Media

Syst

em

Serv

ices

Core

Page 8: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

THE OPPORTUNITY

Page 9: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Opportunity

500M

Windows

234M

Android phones

112M

iPhone

40M

iPad

13M

Android tablets

247M

Android

152M

iOS

30M

Mac

Page 10: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

We are reimagining a partnership

Page 11: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Pricing You control the pricing of your app

Prices from $1.49 to $999.99

Tiered model

Page 12: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Revenue Sharing

Starts at 70%for new apps

Jumps to 80%once your app makes $25,000

Page 13: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Flexibility of options

Existing relationship

Subscriptions

Consumable purchases

Use Your Existing Commerce

Use our ad system

Bring your own

Ad Supported

Time limited trials

Feature differentiated trials

One time Purchase

Persistent purchases

Expiring purchases

Purchases over time

Page 15: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Time-based trials

/* No code*/

Page 16: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Trial conversion // get current productvar currentProduct = Windows.ApplicationModel.Store.CurrentProduct;

// get the license informationvar licenseInformation = currentProduct.licenseInformation;

// check to see if the user has an active non-trial licenseif (licenseInformation.isTrial) { // user has trial version of the application // prompt them to purchase before so we can enable full functionality

currentProduct.requestProductPurchaseAsync().then( function () { // Purchase succeeded

EnableFullFunctionality(); });

}

Page 17: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

In-App Purhase// can’t do in-app purchase in trial mode, must convert first if (!appLicensingInformation.isTrial) {

//load the listings with all the products currentApp.loadListingInformationAsync().then( function (listing) {

//lookup a specific product var product1 = listing.productListings.lookup("product1");

if (!product1.isActive) { // purchase

currentApp.requestProductPurchaseAsync("product1").then( enableProduct1 );

} });

Page 18: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Advertisement Choices

Microsoft AdvertisementYour own

Page 19: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Add advertising to Windows 8 Apps

3

Set Ad Unit/App IDs in your AppSubmit Ad-enabled App to StoreTrack your success at PubCenter

1

Download Ad SDKAdd few lines of code to add AdsSupport for Metro HTML/XAML

2

Sign in to PubCenterRegister your app at PubCenterGenerate App ID and Ad Unit IDs

Activate Live AdsDownload Ad SDK Publish App to Store

www.windowsadvertising.com

Page 20: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

TOOLS

Page 21: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Windows 8 Development tools

Code Editor

WYSIGYG designer

Interactive mode

Animation

Smarter Properties Window

Simulator

Platform window

Expression Blend Code editor w/ Intellisense

UI Designer

Debuggers

DOM Explorer

Javascript Console

Simulator

Platform window

Visual Studio

The development tools are FREE!

If you use a higher SKU, it just works!

Page 22: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Visual Studio 2012 & Blend for Visual Studio 2012

demo

Page 23: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

WEB STANDARDS

Page 24: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

IE10CSS 2D Transforms

CSS 3D Transforms

CSS Animations

CSS Backgrounds & Borders

CSS Color

CSS Flexbox

CSS Fonts

CSS Grid

CSS Hyphenation

CSS Image Values (Gradients)

CSS Media Queries

CSS multi-column Layout

CSS Namespaces

CSS OM Views

CSS Positioned Floats (Exclusions)

CSS Selectors

CSS Transitions

CSS Values and Units

Data URI

DOM Element Traversal

DOM HTML

DOM Level 3 Core

DOM Level 3 Events

DOM Style

DOM Traversal and Range

DOMParser and XMLSerializer

ECMAScript 5

File Reader API

File Saving

FormData

HTML5 Application Cache

HTML5 async

HTML5 BlobBuilder

HTML5 Canvas

HTML5 Drag and drop

HTML5 Forms and Validation

HTML5 Geolocation

HTML5 History API

HTML5 Parser

HTML5 Sandbox

HTML5 Selection

HTML5 semantic elements

HTML5 track

HTML5 video and audio

JavaScript Typed Array

ICC Color Profiles

IndexedDB

Page Visibility

Pointer (Mouse, Pen, and Touch) Events

RequestAnimationFrame

Navigation Timing

Selectors API Level 2

SVG Filter Effects

SVG, standalone and in HTML

Web Messaging

Web Sockets

Web Workers

XHTML/XML

XMLHttpRequest (Level 2)

XMLHttpRequest CORS

Page 25: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Popular CSS3 features in Windows 8

2D & 3D transforms

Transforms Animations

Transitions

MotionGrid

Flexbox

Layout

Gradients

Filter Effects

Text-shadow

GraphicsMulti-column, hyphenation

Pagination

Position float

Content flow

Windows hardware acceleration makes these beautiful and fast

Page 26: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Popular HTML5

features in

Windows 8

Web Sockets

Web Workers

IndexedDB

Ecmascript 5

File API & Blobs

Geolocation

Audio tag

Video tag

Touch-first

Pointer events

Zoom regions

Snap Points

Forms

Validation

Input types

Spell checking

Page 27: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Context in HTML/JS Windows apps

Feature Local context Web context

Windows Run-time Yes No

Windows Library for Javascript

Yes No

External script references

No Yes

Cross-domain XHR requests

Yes No

Automatic filtering for script injection on DOM

Yes No

There are ways to communicate across contexts, ways to give websites access to some web standards features and ways to skip automatic filtering within a function.

Page 28: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Porting from HTML5

demo

Page 29: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

WINJS

Page 30: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Windows Library for JavaScript (WinJS)library for building apps using JavaScript

Web technologies you’re already familiar with

Utilities and patterns for responsive, reliable apps

Use interactive design tools

Build your apps fast and with high quality

Matches the Windows 8 design style

Controls for common user experiences

Designed for touch as well as traditional input

Scales across form factors

Make your apps look and feel great

Page 31: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

WinJS

Helpers for Namespaces, Constructor Definition

Promises

App Model

Navigation

Page & User controls

Data binding

Controls

Animations

Templates

Utilities

Default CSS Styles

Page 32: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

WinJS controls SettingsFlyout

Flyout

Semantic Zoom

Flipview

SemanticZoomListview

Menu

Rating

Slide does not include all WinJS controls (App Bar, Tooltip, ViewBox, ToggleSwitch, HTMLControl, etc.)

DatePicker

Page 33: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Built-in controls implement Microsoft Design Style UI principles

and personality

Page 34: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Designed for touch, mouse, and keyboard

Page 35: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Controls <!– Step1: declare control --> <div id=“list” data-win-control="WinJS.UI.ListView" data-win-options="{ selectionMode: 'none' }"></div>

/* Step 2: Call WinJS.UI.processAll() */ WinJS.UI.processAll();

/* Step 3: Use the control */ document.getElementById(‘list’).winControl.addEventListener(‘selectionchanged’, onSelChanged );

Page 36: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Prefer your own library? Go ahead! Adhere to the Windows UI and personality

Understand our web context & sandboxing model

Mix & match works fine

Page 37: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

FEATURES & THE WINDOWS 8 STORE

Page 38: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

SNAP VIEW

Page 39: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

SnapSnapping is a built-in Windows 8 scenarioBuilding a great snapped view keeps your app on screenDesign a purposeful snapped statePan vertically in snapped for ergonomics and to avoid conflict with the edge and snap gutterMaintain state and continuity across snapping and unsnappingIt is trivially easy to snap and unsnap. Don’t blow away the user’s work when this happens

Page 40: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Designing for snapLayout tailored 320px width

LayoutsScroll vertically instead of horizontallyUse a single columnKeep wire frame still intact

CSS media queries are your friend

Page 41: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

HTML5: CSS media queriesThe view state media queries allow you easily to target portrait and snap views

@media screen and (-ms-view-state: snapped){  /* Re-arrange and hide/show content */}@media screen and (-ms-view-state: device-portrait)@media screen and (-ms-view-state: fill)@media screen and (-ms-view-state: full-screen) Full screen

Snap

Fill

Portrait

Page 42: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Snap view

demo

Page 43: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

SETTING CONTRACTS

Page 44: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Settings contract provides quick,

consistent, in-context access to settings in your app

Page 45: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Settings

demo

Page 46: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

CONCLUSION

Page 47: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

You can build amazing apps with the Windows 8 platform, and HTML5

Page 48: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

dev.windows.com

Page 49: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Free

Open Source

HTML5

Windows 8

template

for Wordpress

MetroPress

Made by

IdeaNotion

http://metropress.codeplex.com

Self-hosted &

Wordpress.com

Easy to use & customize

Windows 8 secret sauce

included

Page 50: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Ready to create the next app phenomenon?developermovement.ca

Page 51: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Rewards examples – more on developermovement.ca

Page 52: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Points structure

Page 53: Toronto User groups workshop - 2013-03-10 - HTML5 & Windows 8, friends with benefits

Questions

Frédéric Harper

[email protected]@fharper

http://webnotwar.cahttp://outofcomfortzone.net