44
An introduction to HTML 5 @ jamespearce

An Intro to Mobile HTML5

Embed Size (px)

Citation preview

Page 1: An Intro to Mobile HTML5

An introduction to HTML 5

@ jamespearce

Page 2: An Intro to Mobile HTML5

Single deviceSedentary userDeclarativeThin client Documents

Multi deviceMobile userImperative

Thick client Applications

*

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

Page 3: An Intro to Mobile HTML5

A badge for all these waysthe web is changing

Page 4: An Intro to Mobile HTML5

MS

RIM

Apple

Google

Top US Smartphone PlatformsAugust 2011, comScore MobiLens

Page 5: An Intro to Mobile HTML5

C#

J2ME/Air

Obj-C

Java/C++

Native programming languages you’ll needUS Smartphones, August 2011

Page 6: An Intro to Mobile HTML5

IE

WebKit

WebKit

WebKit

Browser platforms to targetUS Smartphones, August 2011

Page 7: An Intro to Mobile HTML5

There is no WebKit on Mobile- @ppk

Page 8: An Intro to Mobile HTML5

But at least we are usingone language,one markup,

one style system

Page 9: An Intro to Mobile HTML5

One Stack

Page 10: An Intro to Mobile HTML5
Page 11: An Intro to Mobile HTML5
Page 12: An Intro to Mobile HTML5

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

(all the elements of a modern application platform)

Page 13: An Intro to Mobile HTML5
Page 14: An Intro to Mobile HTML5
Page 15: An Intro to Mobile HTML5

Are we nearly there yet?

Page 16: An Intro to Mobile HTML5

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 17: An Intro to Mobile HTML5

Stay on top of diversity

Can I Use?http://caniuse.com

Modernizrhttp://modernizr.com

DeviceAtlashttp://deviceatlas.com

Page 18: An Intro to Mobile HTML5

Capabilities & specifications

Supp

ort 100%

Browsers

Page 19: An Intro to Mobile HTML5

Capabilities & specifications

100%

Polyfills

Supp

ort

Frameworks Browsers

Page 20: An Intro to Mobile HTML5
Page 21: An Intro to Mobile HTML5

The classic web architecture

Storage

Business logic

User interfacerequest

Rendering

server client

response

Page 22: An Intro to Mobile HTML5

A new web architecture

Storage

Business logic

User interfacesync

server client

Storage

API

Page 23: An Intro to Mobile HTML5

But there is aa place for both

Page 24: An Intro to Mobile HTML5
Page 25: An Intro to Mobile HTML5
Page 26: An Intro to Mobile HTML5

Recent developments

Page 27: An Intro to Mobile HTML5

iOS 5

Input typescontenteditableposition:fixedclassListXHR2Script defer & asyncInline SVGWeb Workers

Page 28: An Intro to Mobile HTML5

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

Page 29: An Intro to Mobile HTML5

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

Page 30: An Intro to Mobile HTML5

window.addEventListener('deviceorientation', function(e) {

var heading = e.webkitCompassHeading + window.orientation;

spinner.style.webkitTransform = 'rotateZ(-' + heading + 'deg)';

}, false);

Page 31: An Intro to Mobile HTML5

Android 4

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

Page 32: An Intro to Mobile HTML5

window.performance

Page 33: An Intro to Mobile HTML5

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

// camcorder// microphone// filesystem

var image = picker.files[0];

Page 34: An Intro to Mobile HTML5

We haven’t even started

Page 35: An Intro to Mobile HTML5

What does the web looklike when you have...

Page 36: An Intro to Mobile HTML5

CameraMicrophone

ContactsCalendar

MessagingTelephony

NFC?

Page 37: An Intro to Mobile HTML5

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 38: An Intro to Mobile HTML5

Accelerometer

Orientation

Camera

DeviceStatus

Filesystem

Messaging

Geolocation

PIM 

Contacts

Calendar

Tasks

DeviceInteraction

APDU (SmartCard)

Bluetooth

Crypto

DLNA

Server Push

Sensor

Telephony

Page 39: An Intro to Mobile HTML5

Telephony

Messaging

Contacts

Clock

Camera

Filesystem

Calculator

Device Status

Settings

Accelerometer

Mouse Lock

Maps

Page 40: An Intro to Mobile HTML5

Mobile device APIs- the web’s great leap forward

Page 41: An Intro to Mobile HTML5

The mobile webbecomes more than a

320px web

Page 42: An Intro to Mobile HTML5

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 43: An Intro to Mobile HTML5

Apps vs web technologybuilt with

Page 44: An Intro to Mobile HTML5

James Pearce @ jamespearce