html5 and the dawn of rich mobile web applications

98

Upload: james-pearce

Post on 11-May-2015

9.840 views

Category:

Technology


4 download

DESCRIPTION

HTML5 and its related technologies are enabling new ways to build beautiful sites and applications for contemporary mobile devices. Native mobile developers can now use web technologies to surmount cross-platform headaches, and desktop web developers can reach mobile users in familiar, app-like ways. This session explores the state of the art in HTML5-based mobile web frameworks, and demonstrates the practical possibilities that this powerful and standards-based approach can bring.

TRANSCRIPT

Page 1: HTML5 and the dawn of rich mobile web applications
Page 2: HTML5 and the dawn of rich mobile web applications

James Pearce Director, Developer Relations @ jamespearce [email protected]

Page 3: HTML5 and the dawn of rich mobile web applications

HTML5 and the dawn of rich mobile web

applications

Page 4: HTML5 and the dawn of rich mobile web applications

or

Page 5: HTML5 and the dawn of rich mobile web applications

Everything I know about HTML5 I learned from

Page 6: HTML5 and the dawn of rich mobile web applications

How Mobile Rolls

Page 7: HTML5 and the dawn of rich mobile web applications

2008

Page 8: HTML5 and the dawn of rich mobile web applications

We must have aniPhone App!

Page 9: HTML5 and the dawn of rich mobile web applications
Page 10: HTML5 and the dawn of rich mobile web applications
Page 11: HTML5 and the dawn of rich mobile web applications

2010

Page 12: HTML5 and the dawn of rich mobile web applications

We must have anAndroid App!

Page 13: HTML5 and the dawn of rich mobile web applications
Page 14: HTML5 and the dawn of rich mobile web applications
Page 15: HTML5 and the dawn of rich mobile web applications

2011

Page 16: HTML5 and the dawn of rich mobile web applications

omfg

Page 17: HTML5 and the dawn of rich mobile web applications

PalmMicrosoft

Apple

Android

RIM RIMAndroidAppleMicrosoftPalm

Top U.S. Smartphone Platforms,3 Month Average Ending December 2010comScore MobiLens 2010

Java

J2ME

Air

C++

C#

Obj-C

JS

Page 18: HTML5 and the dawn of rich mobile web applications

RIM

Microsoft

Android

Apple

Nokia

NokiaAppleAndroidMicrosoftRIM

Top EU5 Smartphone Platforms,3 Month Average Ending December 2010comScore MobiLens 2010

Lua

C

Python

C++

C#

Obj-C

J2ME

http://www.cloudfour.com/a-comprehensive-guide-to-mobile-statistics/

...

Java

Page 19: HTML5 and the dawn of rich mobile web applications
Page 20: HTML5 and the dawn of rich mobile web applications
Page 21: HTML5 and the dawn of rich mobile web applications

Device diversity

Page 22: HTML5 and the dawn of rich mobile web applications

App Stores Updates

Page 23: HTML5 and the dawn of rich mobile web applications

The Promise ofWeb Technologies

Page 24: HTML5 and the dawn of rich mobile web applications

Cross-platformFamiliar skills & toolsDecentralizedEasily updatedIndexedWell-understood...

The Web

Mobile: the next era of the web as we know it

Page 25: HTML5 and the dawn of rich mobile web applications

http://www.victoriassecret.com

Page 26: HTML5 and the dawn of rich mobile web applications

http://mobile.victoriassecret.com

Page 27: HTML5 and the dawn of rich mobile web applications

Themobile web

is not a320px web

Page 28: HTML5 and the dawn of rich mobile web applications

(“responsive web design”)

Page 29: HTML5 and the dawn of rich mobile web applications
Page 30: HTML5 and the dawn of rich mobile web applications
Page 31: HTML5 and the dawn of rich mobile web applications
Page 32: HTML5 and the dawn of rich mobile web applications

Cross-platformFamiliar skills & toolsDecentralizedEasily updatedIndexedWell-understood...

The Web

But wait! Weren’t we talking about apps?

Page 33: HTML5 and the dawn of rich mobile web applications

Web technologiesare a

viable alternativeto native development

Hypothesis:

Page 34: HTML5 and the dawn of rich mobile web applications

ApplicationsDocuments

Programmatic DOMDeclarative HTML

APIsTemplates

ArgumentsURLs

SynchronizationRequest/Response

The Web is Evolving...

Thick clientThin client

Page 35: HTML5 and the dawn of rich mobile web applications
Page 36: HTML5 and the dawn of rich mobile web applications
Page 37: HTML5 and the dawn of rich mobile web applications

localStorage

WebSQL

gradient

-webkit

CSS Text

GeoLocation

canvastype=camera

@page

@mediamanifest

accelerometer

keyframe

transform<video>

Page 38: HTML5 and the dawn of rich mobile web applications
Page 39: HTML5 and the dawn of rich mobile web applications
Page 40: HTML5 and the dawn of rich mobile web applications
Page 41: HTML5 and the dawn of rich mobile web applications

this is uncanny

Page 42: HTML5 and the dawn of rich mobile web applications

A New Mobile App Stack

Worker Parallel

Processing

File SystemsDBs

App Cache

Javascript

Semantic HTML

CSS Styling & Layout

WebFonts Video Audio Graphics

x-AppMessaging

Device Access

Camera

Location

Contacts

SMS

Orientation

Gyro

Server & Services

HTTP

AJAX

Events

Sockets

SSL

More...

Page 43: HTML5 and the dawn of rich mobile web applications

Rich Media & StylingFull Resource Access

Parallel ProcessingInter-App Communication

Full O!ine Capability COMPLETE MODERN APP PLATFORM

Page 44: HTML5 and the dawn of rich mobile web applications
Page 45: HTML5 and the dawn of rich mobile web applications
Page 46: HTML5 and the dawn of rich mobile web applications
Page 47: HTML5 and the dawn of rich mobile web applications

Web technologiesare a

viable alternativeto native development

Page 48: HTML5 and the dawn of rich mobile web applications

Caveats?Performance

Browser support

Device access

Discoverability

Monetization

App ‘experience’

All less of a issuethan you might think

Page 49: HTML5 and the dawn of rich mobile web applications

Progressive enhancement

Page 50: HTML5 and the dawn of rich mobile web applications

JSCS

S

apppr

ogre

ssiv

een

hanc

emen

t

HTM

L

doc

assu

mpt

ion

HTM

LJS

CSS

app

assu

mpt

ion

vs

Page 51: HTML5 and the dawn of rich mobile web applications

State of the Art:Mobile HTML5

Page 52: HTML5 and the dawn of rich mobile web applications

Environments

?

Page 53: HTML5 and the dawn of rich mobile web applications

Browsers

WebKit FOEs

Page 54: HTML5 and the dawn of rich mobile web applications

HTML5 supportIE 9 PR Chrome 7 Safari 5 Firefox 4b iPhone 4 BB Torch Android 2.2

@font-faceCanvasHTML5 Audio & Videorgba(), hsla()border-image:border-radius:box-shadow:text-shadow:opacity:Multiple backgroundsFlexible Box ModelCSS AnimationsCSS ColumnsCSS GradientsCSS ReflectionsCSS 2D TransformsCSS 3D TransformsCSS TransitionsGeolocation APIlocal/sessionStorageSVG/SVG ClippingSMILInline SVGDrag and DrophashchangeX-window MessagingHistory ManagementapplicationCacheWeb SocketsWeb WorkersWeb SQL DatabaseWebGLIndexedDB

Page 55: HTML5 and the dawn of rich mobile web applications

Stay on top of diversityCan I Use?http://caniuse.com

Modernizrhttp://modernizr.com

DeviceAtlashttp://deviceatlas.com

Page 56: HTML5 and the dawn of rich mobile web applications

Enter The Framework

Page 57: HTML5 and the dawn of rich mobile web applications

Why use a framework?Provide user interface components

Smooth browser inconsistencies

Mimic native or server paradigms

Create consistent application architectures

...and more

Page 58: HTML5 and the dawn of rich mobile web applications
Page 59: HTML5 and the dawn of rich mobile web applications

Strokes for folks

ApplicationsSites & Documents

Programmatic DOMDeclarative HTML

APIsTemplates

ArgumentsURLs

SynchronizationRequest/Response

Thick clientThin client

Page 60: HTML5 and the dawn of rich mobile web applications

jQTouchUI layer on top of jQueryDeclarative HTMLLibrary progressively enhancesBrowsers: iOS (iPhone/iPod) Android BlackBerry v6 Most WebKit-based browsers

http://jQTouch.com

Page 61: HTML5 and the dawn of rich mobile web applications

jQTouchScripts & stylesheets

CSS classes for semantics & config

Page 62: HTML5 and the dawn of rich mobile web applications

jQuery Mobile (alpha)

UI layer on top of jQueryDeclarative HTMLLibrary progressively enhancesBrowsers: iOS (iPhone/iPad) Android BlackBerry v5+ Symbian v5, MeeGo, webOS

http://jquerymobile.com

Page 63: HTML5 and the dawn of rich mobile web applications

jQuery Mobile

data-* for semantics& config

Scripts & stylesheet

Page 64: HTML5 and the dawn of rich mobile web applications

Sencha TouchSelf-contained libraryProgrammatic JavascriptStandalone MVC applicationsBrowsers: iOS (iPhone/iPad) Android BlackBerry v6 & QNX Bada, MeeGo & other WebKit Windows Phone 7*

http://sencha.com/touch

* to come

Page 65: HTML5 and the dawn of rich mobile web applications

Sencha Touch

Data model& records

Programmatically createtoolbar & list

Page 66: HTML5 and the dawn of rich mobile web applications

Layouts & components Theming & icons Orientation & animationTouch events & scrollerData packageMVC framework

What’s in a good framework?

Page 67: HTML5 and the dawn of rich mobile web applications

Lists - Nested, Grouped, SortableCarouselPickerOverlaySliderForms & fieldsToolbars & buttonsHTML5 - Audio - Video - GeoLocation

Components

Page 68: HTML5 and the dawn of rich mobile web applications

Use CSS3 & SASS - Flexible themes - Highly optimized

Theming

Page 69: HTML5 and the dawn of rich mobile web applications

Forms

Page 70: HTML5 and the dawn of rich mobile web applications

ScrollingMomentum/bounce physics

Hardware accelerated

Throughout all components: - Lists - Carousel - Pickers

Page 71: HTML5 and the dawn of rich mobile web applications

Touch EventsBuilt on native events

Abstracted for performance

Additional events - Tap - Double tap - Tap and hold - Swipe - Rotate - Drag & drop

Page 72: HTML5 and the dawn of rich mobile web applications

Data PackageModels, Stores, and Proxies - Associations - Validation - Local & server storage

Easily consume web services - JSON/P - XML - YQL

Page 73: HTML5 and the dawn of rich mobile web applications

“The Kitchen Sink”

http://sencha.com/x/5e

Page 74: HTML5 and the dawn of rich mobile web applications

Implementing Mobile WebSites|Apps

Page 75: HTML5 and the dawn of rich mobile web applications

Evolving sites for mobile

HTML, CSS...

Models

Controllers

Views

Page 76: HTML5 and the dawn of rich mobile web applications

Evolving sites for mobile

Models

Controllers

Mobile

DesktopSw

itch

er HTML, CSS...

Page 77: HTML5 and the dawn of rich mobile web applications

Mobile detection

class ApplicationController < ActionController::Base has_mobile_fuend

*.mobile.erb

is_mobile_device?in_mobile_view?

https://github.com/brendanlim/mobile-fu

Page 78: HTML5 and the dawn of rich mobile web applications

Smart detection& user choice

“Switch to our desktop site”

Page 79: HTML5 and the dawn of rich mobile web applications
Page 80: HTML5 and the dawn of rich mobile web applications

Thematic consistency

w3c-speak

http://mysite.com/posts/123

http://mysite.mobi/posts/123

Page 81: HTML5 and the dawn of rich mobile web applications

Mobile switching

http://tinyurl.com/mobswi1 http://tinyurl.com/mobswi2

Page 82: HTML5 and the dawn of rich mobile web applications

Then to an app...

JSON

Models

Controllers

Mobile

DesktopSw

itch

ers

REST

Page 83: HTML5 and the dawn of rich mobile web applications

Thematic consistency

http://mysite.com/posts/123

http://mysite.com/#!/posts/123

Page 84: HTML5 and the dawn of rich mobile web applications

The stack of the present

Storage

Business logic

User interfacereq/res

Rendering

Page 85: HTML5 and the dawn of rich mobile web applications

The stack of the future

Storage

Security Business logic

User interfacesync

Storage

The return of the thick client!

Page 86: HTML5 and the dawn of rich mobile web applications

Do we have time forsome code?

Page 87: HTML5 and the dawn of rich mobile web applications

Brand consistency

Page 88: HTML5 and the dawn of rich mobile web applications

Getting help from the cloud

http://i.tinysrc.mobi/http://mysite.com/myimage.png

http://tinysrc.net/

Page 89: HTML5 and the dawn of rich mobile web applications

Mobile devicesare di"erent

Telephony

Geolocation

Camera

Messaging

And mobile usersare different too!

Page 90: HTML5 and the dawn of rich mobile web applications

Going Hybrid

Page 91: HTML5 and the dawn of rich mobile web applications

A platform that allows you to author native applicationswith web technologies and get access to device APIs

http://phonegap.com

PhoneGap

Page 92: HTML5 and the dawn of rich mobile web applications

+

Page 93: HTML5 and the dawn of rich mobile web applications

Full API list:

http://www.sencha.com/learn/Tutorial:Sencha_Touch_PhoneGap

FileGeolocationMediaNetworkNotificationStorage

AccelerometerCameraCompassContactsDeviceEvents

http://docs.phonegap.com

Page 94: HTML5 and the dawn of rich mobile web applications

PhoneGap Build

Page 95: HTML5 and the dawn of rich mobile web applications

A word about app stores

(pssst: they’re an admission of defeat)

Page 96: HTML5 and the dawn of rich mobile web applications

Doing mobile right

Everyone loves apps - but native development sucks

This is the year of the mobile web - but caveats apply

Web technologies are a viable alternative to native apps

Page 97: HTML5 and the dawn of rich mobile web applications

Apps vs Web technologybuilt with

Page 98: HTML5 and the dawn of rich mobile web applications

James Pearce Director, Developer Relations @ jamespearce [email protected]