HTML5 and the dawn of rich mobile web applications pt 1

91
HTML5 and the dawn of rich mobile web applications @ jamespearce

description

 

Transcript of HTML5 and the dawn of rich mobile web applications pt 1

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

HTML5 and the dawn of rich mobile web applications

@ jamespearce

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

Part I

Mobile & HTML5

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

Sir Isaac Newton

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

Three Laws of Motion

(the universe works as we might expect it to)

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

Edward MorleyAlbert Michelson

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

Light Travels at aConstant Speed

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

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

Classical Mechanics

Relativistic Mechanics

Quantum Mechanics

Familiarity

Exploration

Exploration

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

The Web Todayis like

Physics in 1900

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

Mobileis our Michelson-Morley

Experiment

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

Mobile Context?One Web?

Responsive Design?Apps or Sites?

(an inability to answer these questions doesnot constitute an excuse not to innovate)

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

Responsive Web Design

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

@media screen and (max-width: 480px) { #logo { background-image: url(mobile.png); }}

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

Mobile devices are di!erent

Messaging

Telephone

Camera

Compass

Mobile users are di!erent

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

Content-Type: application/msword

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

The Mobile Webis not a

320px Web

Page 18: HTML5 and the dawn of rich mobile web applications pt 1
Page 19: HTML5 and the dawn of rich mobile web applications pt 1
Page 20: HTML5 and the dawn of rich mobile web applications pt 1
Page 21: HTML5 and the dawn of rich mobile web applications pt 1
Page 22: HTML5 and the dawn of rich mobile web applications pt 1
Page 23: HTML5 and the dawn of rich mobile web applications pt 1
Page 24: HTML5 and the dawn of rich mobile web applications pt 1
Page 25: HTML5 and the dawn of rich mobile web applications pt 1

Single deviceSedentary userDeclarativeThin client Documents

Multi deviceMobile userImperative

Thick client Applications

*

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

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

A badge for all these waysthe web is changing

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

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 28: HTML5 and the dawn of rich mobile web applications pt 1

What is an app?

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

2008

We must have aniPhone App!

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

2009

We must have anAndroid App!

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

2010

We must have aniPad App!

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

2011

We must have a...

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

omfg

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

What is an app?

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

Consumption vs CreationLinkability

User ExperienceArchitecture

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

Nativeness

Com

prom

ise

Nativeapps

Websites

Webapps

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

JavaScript

Semantic HTML

CSS Styling & Layout

WebFont Video Audio Graphics

Workers & Parallel

Processing

File SystemsDatabasesApp Caches

Cross-AppMessaging

Device Access

Camera

Location

Contacts

SMS

Orientation

Gyro

Network

HTTP

AJAX

Events

Sockets

SSL

(all the elements of a modern application platform)

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

The web is now as mucha stack

as it is a medium

Page 43: HTML5 and the dawn of rich mobile web applications pt 1
Page 44: HTML5 and the dawn of rich mobile web applications pt 1
Page 45: HTML5 and the dawn of rich mobile web applications pt 1

MS

RIM

Apple

Android

Symbian

Top European Smartphone PlatformsJuly 2011, comScore MobiLens

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

.NET

J2ME

Obj-C

Java

C++

Native programming languages you’ll needJuly 2011

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

IE

WebKit

WebKit

WebKit

WebKit

Browser platforms to targetJuly 2011

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

There is no WebKit on Mobile- @ppk

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

But at least we are usingone language,one markup,

one style system

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

IE 10 PR Chrome 10 Safari 5 Firefox 4 iOS4.31 Playbook Honeycomb@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 51: HTML5 and the dawn of rich mobile web applications pt 1

Stay on top of diversity

Can I Use?http://caniuse.com

Modernizrhttp://modernizr.com

DeviceAtlashttp://deviceatlas.com

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

Capabilities & specifications

Supp

ort 100%

Browsers

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

Capabilities & specifications

100%

Polyfills

Supp

ort

Frameworks Browsers

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

<!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 56: HTML5 and the dawn of rich mobile web applications pt 1
Page 57: HTML5 and the dawn of rich mobile web applications pt 1

<!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 58: HTML5 and the dawn of rich mobile web applications pt 1
Page 59: HTML5 and the dawn of rich mobile web applications pt 1

Evolving the web for mobile

HTML, CSS...

Models

Controllers

Views

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

Models

Controllers

Mobile

DesktopSw

itch

er HTML, CSS...

Evolving the web for mobile

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

JSON

Models

Controllers

Mobile

DesktopSw

itch

ers

RESTonce

Evolving the web for mobile

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

The classic web stack

Storage

Business logic

User interfacereq/res

Rendering

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

A new web stack

Storage

Security Business logic

User interfacesync

Storage

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

Write once,run anywhere?

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

The Mobile Webis not a

320px Web

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

Proxies

Models

Controllers

Stores

Views Views

json

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

http://sencha.com/x/cv

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

Thick client, thin server

The shortfall in the cloud

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

Location Services

Image Serving

AnalyticsAdaptation

Video Serving

Data SyncWeb Fonts

Ad Serving

Commerce$

Network APIs

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

http://mysite.com/myimage.png

http://src.sencha.io/http://mysite.com/myimage.png

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

Myths & rumors

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

HTML5 apps can’trun o!ine

(hybrid, appcache, and localStorage...)

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

Going o"ine

http://github.com/jamesgpearce/confess

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

HTML5 apps can’t match native performance

(true, sometimes)

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

HTML5 apps can’t be monetized

(is this a technology problem?)

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

HTML5 apps are more e"cient to develop

(yes, in theory, but diversity remains)

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

24 dev-monthsfor iOS

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

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

12 further dev-monthsfor Android & BlackBerry

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

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

...but more engagement thanthe native app

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

Nativeness

Com

prom

ise

Nativeapps

Websites

Webapps

Hybridapps

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

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 85: HTML5 and the dawn of rich mobile web applications pt 1

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 86: HTML5 and the dawn of rich mobile web applications pt 1

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 87: HTML5 and the dawn of rich mobile web applications pt 1
Page 88: HTML5 and the dawn of rich mobile web applications pt 1

Native app storeshave a dirty secret

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

Apps vs web technologybuilt with

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

James Pearce @ jamespearce