84
A Snapshot of the Mobile HTML5 Revolution @ jamespearce

A Snapshot of the Mobile HTML5 Revolution

Embed Size (px)

DESCRIPTION

HTML5 Live conference, November 2011

Citation preview

Page 1: A Snapshot of the Mobile HTML5 Revolution

A Snapshot of the Mobile HTML5 Revolution

@ jamespearce

Page 2: A Snapshot of the Mobile HTML5 Revolution

The Pledge

Page 3: A Snapshot of the Mobile HTML5 Revolution

Single deviceSedentary userDeclarativeThin client Documents

Multi deviceMobile userImperative

Thick client Applications

*

* or supine, or sedentary, or passive, or...

Page 4: A Snapshot of the Mobile HTML5 Revolution

A badge for all these waysthe web is changing

Page 5: A Snapshot of the Mobile HTML5 Revolution

HTML5 is a new version of HTML4, XHTML1, and DOM Level 2 HTML addressing many of the issues of those specifications while at the same time enhancing (X)HTML

to more adequately address Web applications.

- WHATWG Wiki

Page 6: A Snapshot of the Mobile HTML5 Revolution

WHATWG

Page 7: A Snapshot of the Mobile HTML5 Revolution

What is an Application?

Page 8: A Snapshot of the Mobile HTML5 Revolution

Consumption vs Creation?Linkable?

User Experience?Architecture?

Page 9: A Snapshot of the Mobile HTML5 Revolution

Nativeness

Site

Nativeapps

Websites

Webapps

App

Page 10: A Snapshot of the Mobile HTML5 Revolution

MS

RIM

Apple

Google

Top US Smartphone PlatformsAugust 2011, comScore MobiLens

Page 11: A Snapshot of the Mobile HTML5 Revolution

C#

J2ME/Air

Obj-C

Java/C++

Native programming languages you’ll needAugust 2011

Page 12: A Snapshot of the Mobile HTML5 Revolution

IE

WebKit

WebKit

WebKit

Browser platforms to targetAugust 2011

Page 13: A Snapshot of the Mobile HTML5 Revolution

There is no WebKit on Mobile- @ppk

Page 14: A Snapshot of the Mobile HTML5 Revolution

But at least we are usingone language,one markup,

one style system

Page 15: A Snapshot of the Mobile HTML5 Revolution

One Stack

Page 16: A Snapshot of the Mobile HTML5 Revolution

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio Graphics

Cross-AppMessaging

Camera

Location

Contacts

SMS

Orientation

Gyro

HTTP

AJAX

Events

Sockets

SSL

Page 17: A Snapshot of the Mobile HTML5 Revolution
Page 18: A Snapshot of the Mobile HTML5 Revolution
Page 19: A Snapshot of the Mobile HTML5 Revolution

The Turn

Page 20: A Snapshot of the Mobile HTML5 Revolution

IE Chrome Safari Firefox iOS BBX Android@font-face

CanvasHTML5 Audio & Video

rgba(), hsla()border-image:border-radius:

box-shadow:text-shadow:

opacity:Multiple backgrounds

Flexible Box ModelCSS Animations

CSS ColumnsCSS Gradients

CSS ReflectionsCSS 2D TransformsCSS 3D Transforms

CSS TransitionsGeolocation API

local/sessionStorageSVG/SVG Clipping

SMILInline SVG

Drag and Drophashchange

X-window MessagingHistory Management

applicationCacheWeb SocketsWeb Workers

Web SQL DatabaseWebGL

IndexedDB

Page 21: A Snapshot of the Mobile HTML5 Revolution

Stay on top of diversity

Can I Use?http://caniuse.com

Modernizrhttp://modernizr.com

DeviceAtlashttp://deviceatlas.com

Page 22: A Snapshot of the Mobile HTML5 Revolution

Capabilities & specifications

Supp

ort 100%

Browsers

Page 23: A Snapshot of the Mobile HTML5 Revolution

Capabilities & specifications

100%

Polyfills

Supp

ort

Frameworks Browsers

Page 24: A Snapshot of the Mobile HTML5 Revolution
Page 25: A Snapshot of the Mobile HTML5 Revolution

<!DOCTYPE html><html> <head> <title>jQuery Mobile</title> <script src="jq.js"></script><script src="jqm.js"></script> <link rel="stylesheet" href="jqm.css" /> </head> <body> <div data-role="page" id="home"> <div data-role="header"> <h1>Hello World</h1> </div> <div data-role="content"> <ul data-role="listview" data-inset="true"> <li data-role="list-divider">Continents</li> <li><a href="na.html">North America</a></li> <li><a href="sa.html">South America</a></li> <li><a href="eu.html">Europe</a></li> </ul> </div> </div> </body></html>

Page 26: A Snapshot of the Mobile HTML5 Revolution
Page 27: A Snapshot of the Mobile HTML5 Revolution

<!DOCTYPE html><html> <head> <title>Sencha Touch</title> <script src="st.js"></script> <link rel="stylesheet" href="st.css" /> <script type="text/javascript" charset="utf-8">

new Ext.Application({ launch: function() { var continents = new Ext.data.Store({ model: Ext.regModel('', {fields: ['name', 'link']}), data: [ {name: 'North America', link:'na'}, {name: 'South America', link:'sa'}, {name: 'Europe', link:'eu'} ] }); new Ext.Panel({ fullscreen: true, dockedItems: [{ xtype: 'toolbar', title: 'Hello World', }], items: [{ xtype: 'list', store: continents, itemTpl: '{name}' }] }); } });

</script> </head><body></body></html>

Page 28: A Snapshot of the Mobile HTML5 Revolution
Page 29: A Snapshot of the Mobile HTML5 Revolution

One Web stack

Storage

Business logic

User interfacerequest

Rendering

server client

response

Page 30: A Snapshot of the Mobile HTML5 Revolution

An Alternative Web Stack

Storage

Business logic

User interfacesync

server client

Storage

API

Page 31: A Snapshot of the Mobile HTML5 Revolution

But there is aa place for both

Page 32: A Snapshot of the Mobile HTML5 Revolution
Page 33: A Snapshot of the Mobile HTML5 Revolution
Page 34: A Snapshot of the Mobile HTML5 Revolution

But...

Page 35: A Snapshot of the Mobile HTML5 Revolution

HTML5 apps can’t match native performance

(true, sometimes)

Page 36: A Snapshot of the Mobile HTML5 Revolution

http://vimeo.com/30296006

http://vimeo.com/30324079

Page 37: A Snapshot of the Mobile HTML5 Revolution

Are HTML5 apps more e!cient to develop?

(yes, in theory, but it’s early days)

Page 38: A Snapshot of the Mobile HTML5 Revolution
Page 39: A Snapshot of the Mobile HTML5 Revolution

24 dev-monthsfor iOS

http://blog.cohen-rose.org/2011/10/over-air-2011-ft-web-app-weve-got.html

Page 40: A Snapshot of the Mobile HTML5 Revolution

12 further dev-monthsfor Android & BlackBerry

http://blog.cohen-rose.org/2011/10/over-air-2011-ft-web-app-weve-got.html

Page 41: A Snapshot of the Mobile HTML5 Revolution

...but more engagement thanthe native app

Page 42: A Snapshot of the Mobile HTML5 Revolution

Mobile HTML5 development

lacks good tooling

(yes)

Page 43: A Snapshot of the Mobile HTML5 Revolution

http://github.com/jamesgpearce/confess

Page 44: A Snapshot of the Mobile HTML5 Revolution

Weinre

Page 45: A Snapshot of the Mobile HTML5 Revolution

HTML5 appscan’t be monetized,can’t be distributed

(not a technology problem)

Page 46: A Snapshot of the Mobile HTML5 Revolution

Nativeness

Com

prom

ise

Nativeapps

Websites

Webapps

Hybridapps

Page 47: A Snapshot of the Mobile HTML5 Revolution

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio Graphics

Cross-AppMessaging

Camera

Location

Contacts

SMS

Orientation

Gyro

HTTP

AJAX

Events

Sockets

SSL

Page 48: A Snapshot of the Mobile HTML5 Revolution

Browser

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio Graphics

Cross-AppMessaging

Camera

Location

Contacts

SMS

Orientation

Gyro

HTTP

AJAX

Events

Sockets

SSL

Page 49: A Snapshot of the Mobile HTML5 Revolution

Native Wrapper

WebView

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio Graphics

Cross-AppMessaging

Camera

Location

Contacts

SMS

Orientation

Gyro

HTTP

AJAX

Events

Sockets

SSL

Page 50: A Snapshot of the Mobile HTML5 Revolution
Page 51: A Snapshot of the Mobile HTML5 Revolution

Native app storeshave a dirty secret

Page 52: A Snapshot of the Mobile HTML5 Revolution
Page 53: A Snapshot of the Mobile HTML5 Revolution

HTML5 appscan’t access

device functionality

(goddamn it)

Page 54: A Snapshot of the Mobile HTML5 Revolution

Native Wrapper

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

Cross-AppMessaging

Camera

Location

Contacts

SMS

Orientation

Gyro

WebView

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio GraphicsHTTP

AJAX

Events

Sockets

SSL

Page 55: A Snapshot of the Mobile HTML5 Revolution

Hybrid apps - the ultimate polyfill

Page 56: A Snapshot of the Mobile HTML5 Revolution

PhoneGap^H^H^HApache Callback

AppMobiNimbleKit

Page 57: A Snapshot of the Mobile HTML5 Revolution

Recent browser updates

Page 58: A Snapshot of the Mobile HTML5 Revolution

iOS 5

Input typescontenteditableposition:fixedclassListXHR2Script defer & asyncInline SVGWeb Workers

Page 59: A Snapshot of the Mobile HTML5 Revolution

overflow: scroll;-webkit-overflow-scrolling: touch;

Page 60: A Snapshot of the Mobile HTML5 Revolution

http://jamesgpearce.github.com/compios5/

Page 61: A Snapshot of the Mobile HTML5 Revolution

Android 4

SVG at allCSS3 3D transformsclassListXHR2Script defer & async<details> & <summary>File readerDevice orientationNavigation timing

Page 62: A Snapshot of the Mobile HTML5 Revolution

window.performance

Page 63: A Snapshot of the Mobile HTML5 Revolution

<input type="file" id="picker" accept="image/*" capture="camera">

// camcorder// microphone// filesystem

var image = picker.files[0];

Page 64: A Snapshot of the Mobile HTML5 Revolution

The Prestige

Page 65: A Snapshot of the Mobile HTML5 Revolution

Sir Isaac Newton

Page 66: A Snapshot of the Mobile HTML5 Revolution

Three Laws of Motion

(the universe works as we might expect it to)

Page 67: A Snapshot of the Mobile HTML5 Revolution

Edward MorleyAlbert Michelson

Page 68: A Snapshot of the Mobile HTML5 Revolution

Light Travels at aConstant Speed

(the universe doesn’t work as we thought it would)

Page 69: A Snapshot of the Mobile HTML5 Revolution
Page 70: A Snapshot of the Mobile HTML5 Revolution

Classical Mechanics

Relativistic Mechanics

Quantum Mechanics

Familiarity

Exploration

Exploration

Page 71: A Snapshot of the Mobile HTML5 Revolution

The Web Todayis like

Physics in 1900

Page 72: A Snapshot of the Mobile HTML5 Revolution

Mobileis our Michelson-Morley

Experiment

Page 73: A Snapshot of the Mobile HTML5 Revolution

Apps or Sites?Responsive Design?Browser diversity?Mobile Context?

One Web?(an inability to answer these questions does

not constitute an excuse not to innovate)

Page 74: A Snapshot of the Mobile HTML5 Revolution

What does the web looklike when you have...

Page 75: A Snapshot of the Mobile HTML5 Revolution

CameraMicrophone

ContactsCalendar

MessagingTelephony

NFC?

Page 76: A Snapshot of the Mobile HTML5 Revolution

Media Capture (HTML)

Battery status

Contacts

Messaging (SMS, MMS...)

Network Information API

Media Capture (API)

Application Registration

Calendar

Feature Permissions

Sensor API

Vibration API

Menu API

Permissions for APIsAudio Volume

Beep

Gallery

Systems info and events

Tasks

Page 77: A Snapshot of the Mobile HTML5 Revolution

Accelerometer

Orientation

Camera

DeviceStatus

Filesystem

Messaging

Geolocation

PIM 

Contacts

Calendar

Tasks

DeviceInteraction

APDU (SmartCard)

Bluetooth

Crypto

DLNA

Server Push

Sensor

Telephony

Page 78: A Snapshot of the Mobile HTML5 Revolution

Telephony

Messaging

Contacts

Clock

Camera

Filesystem

Calculator

Device Status

Settings

Accelerometer

Mouse Lock

Maps

Page 79: A Snapshot of the Mobile HTML5 Revolution

The mobile web becomesmore than a 320px web

Page 80: A Snapshot of the Mobile HTML5 Revolution

window.addEventListener( 'appointmentdue', function(appt) { if (device.near(WORK)) { siri.remind( contacts.get('Peter'), calendar.getDetails(appt) ); } }, false);

(PS: This code does not work. Yet)

Page 81: A Snapshot of the Mobile HTML5 Revolution
Page 82: A Snapshot of the Mobile HTML5 Revolution

Mobile device APIs arethe web’s next

great leap forward

Page 83: A Snapshot of the Mobile HTML5 Revolution
Page 84: A Snapshot of the Mobile HTML5 Revolution

James Pearce @ jamespearce