Download - HTML5 unplugged

Transcript
Page 1: HTML5 unplugged

[email protected]

HTML5unplugged

Dienstag, 11. Februar 14

Page 2: HTML5 unplugged

The tale of the evernet

Dienstag, 11. Februar 14

Page 3: HTML5 unplugged

The World Wide Web. An evernet?

Dienstag, 11. Februar 14

Page 4: HTML5 unplugged

Dienstag, 11. Februar 14

Page 5: HTML5 unplugged

In der freien Natur weitab von high speed Internet

Dienstag, 11. Februar 14

Page 6: HTML5 unplugged

in Tiefgaragen und anderen unterirdischen Räumen

Dienstag, 11. Februar 14

Page 7: HTML5 unplugged

Auf Reisen im Zug...

Dienstag, 11. Februar 14

Page 8: HTML5 unplugged

Text

...spätestens in Tunnels

Dienstag, 11. Februar 14

Page 9: HTML5 unplugged

beim Sparen von Roamingkosten

Dienstag, 11. Februar 14

Page 10: HTML5 unplugged

Dienstag, 11. Februar 14

Page 11: HTML5 unplugged

OfflineTechnology

Dienstag, 11. Februar 14

Page 12: HTML5 unplugged

das Web wird sesshaft

Dienstag, 11. Februar 14

Page 13: HTML5 unplugged

resources

appcache

app state

localStorage File API Database API*

html, css, js, json, xml, png, mp3,

mp4

data sources

Dienstag, 11. Februar 14

Page 14: HTML5 unplugged

appcache localStorage File API Database API*

Dienstag, 11. Februar 14

Page 15: HTML5 unplugged

Resource cachingDienstag, 11. Februar 14

Page 17: HTML5 unplugged

Server Browser

GET /*.* HTTP/1.1

HTTP/1.1 200 OK

GET /sbb.appcache HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

Dienstag, 11. Februar 14

Page 18: HTML5 unplugged

Server Browser

GET /*.* HTTP/1.1

HTTP/1.1 200 OK

GET /sbb.appcache HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

Dienstag, 11. Februar 14

Page 19: HTML5 unplugged

Server Browser

GET /*.* HTTP/1.1

HTTP/1.1 200 OK

GET /sbb.appcache HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

GET /styles.css HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

Dienstag, 11. Februar 14

Page 20: HTML5 unplugged

Server Browser

GET /*.* HTTP/1.1

HTTP/1.1 200 OK

GET /sbb.appcache HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

GET /styles.css HTTP/1.1

HTTP/1.1 200 OK

GET /index.html HTTP/1.1

HTTP/1.1 200 OK

GET /app.js HTTP/1.1

HTTP/1.1 200 OK

Dienstag, 11. Februar 14

Page 21: HTML5 unplugged

1015 5.11222Mobile Desktop WWW

offline resource cache 64.88%

Dienstag, 11. Februar 14

Page 22: HTML5 unplugged

reloadreloadreload

livedemo

Dienstag, 11. Februar 14

Page 23: HTML5 unplugged

Application stateDienstag, 11. Februar 14

Page 24: HTML5 unplugged

{setLastCheckDate: function() {

localStorage.lastCacheCheck = new Date();console.log(typeof localStorage.lastCacheCheck); // string

},getLastCheckDate: function () {

if (localStorage.lastCacheCheck) {return new Date(localStorage.lastCacheCheck);

} else {return undefined;

} }}

localStorage

Dienstag, 11. Februar 14

Page 25: HTML5 unplugged

var storage = {store: function(name, obj) {

localStorage[name] = JSON.stringify(obj);},read: function (name) {

if (localStorage[name]) {return JSON.parse(localStorage[name]);

} else {return undefined;

} }};

localStorage

Dienstag, 11. Februar 14

Page 26: HTML5 unplugged

815 5.11222Mobile Desktop WWW

localStorage and sessionStorage 91.85%

Dienstag, 11. Februar 14

Page 27: HTML5 unplugged

Data sourcesDienstag, 11. Februar 14

Page 28: HTML5 unplugged

var db = openDatabase("fahrplan", "1.0", "SBB", 50*1024*1024);

db.transaction(function(tx) { tx.executeSql("SELECT * FROM favorite", [], ! ! ! function success (tx, rs) {! ! ! ! callback({! ! ! ! ! connections: rs.rows! ! ! ! });! ! ! },! ! ! function error () {! ! ! ! console.error(arguments);! ! ! }

);});

SQL select

Dienstag, 11. Februar 14

Page 29: HTML5 unplugged

transaction.executeSql(! "INSERT INTO favorite(dep, arrival)" + ! "VALUES (?,?)",

! [! connection.departure, ! connection.arrival],

! successHandler,! errorHandler);

SQL insert

Dienstag, 11. Februar 14

Page 30: HTML5 unplugged

-- 5.11222Mobile Desktop WWW

Web SQL API 45.44%

Dienstag, 11. Februar 14

Page 31: HTML5 unplugged

1015 --22Mobile Desktop WWW

Indexed DB API 17.92%

Dienstag, 11. Februar 14

Page 32: HTML5 unplugged

1015 5.11222Mobile Desktop WWW

Indexed or SQL DB API ~60%

Dienstag, 11. Februar 14

Page 33: HTML5 unplugged

Network monitoringDienstag, 11. Februar 14

Page 34: HTML5 unplugged

window.addEventListener("offline", function(e) { $("#network-monitor").removeClass("online");}, false);

window.addEventListener("online", function(e) { $("#network-monitor").addClass("online");}, false);

var search = function (callback) {

if (navigator.onLine) { $.ajax({success: callback});} else { callback(localStorage.lastSearch);}

}

network state

Dienstag, 11. Februar 14

Page 37: HTML5 unplugged

// register global ajax handlers $(document).ajaxSuccess(setOnline);$(document).ajaxError(setOffline);

// check for backend server availabiliyvar checkServerAvailability = function (callback) {! $.ajax({! url: "data/probe.json",

! ! dataType: "json",! ! timeout: CONNECTION_TIMEOUT,! ! complete: callback || function () {}! });};

checkServerAvailability();

Server availability

Dienstag, 11. Februar 14

Page 38: HTML5 unplugged

Platformintegration

Dienstag, 11. Februar 14

Page 39: HTML5 unplugged

Safari iOS

Cordova/Worklight

Firefox AndroidFirefox Aurora

Windows RT

OSX Dashboard

stan

dalo

neW

WW

Desktop Mobile

CEF/App.js/Brakets shell Firefox OS

Dienstag, 11. Februar 14

Page 40: HTML5 unplugged

Safari iOS

Cordova/Worklight

Firefox AndroidFirefox Aurora

Windows RT

OSX Dashboard

stan

dalo

neW

WW

Desktop Mobile

CEF/App.js/Brakets shell Firefox OS

standalone

standalone

standalone

Dienstag, 11. Februar 14

Page 41: HTML5 unplugged

Safari iOS

Cordova/Worklight

Firefox AndroidFirefox Aurora

Windows RT

OSX Dashboard

stan

dalo

neW

WW

Desktop Mobile

CEF/App.js/Brakets shell Firefox OS

Appstore

Appstore

Appstore Appstore

Appstore

Appstore

Appstore

standalone

standalone

standalone

Dienstag, 11. Februar 14

Page 42: HTML5 unplugged

Modern Browsers

+ Desktop/Tablet/Phone + Simple Deployment + Bookmark, Favorites, Pinned Site/Tabs+ Browser Home als Einstiegspunkt+ Fullscreen Modus verfügbar

- keine Desktop-Integration- Abhängigkeit vom Browser als Platform

Dienstag, 11. Februar 14

Page 43: HTML5 unplugged

Add to Home Screen

Dienstag, 11. Februar 14

Page 44: HTML5 unplugged

Add to Home Screen

Dienstag, 11. Februar 14

Page 45: HTML5 unplugged

Add to Home Screen

Dienstag, 11. Februar 14

Page 46: HTML5 unplugged

reloadreloadreload

livedemo

Dienstag, 11. Februar 14

Page 47: HTML5 unplugged

iOS und Android Apps

Dienstag, 11. Februar 14

Page 48: HTML5 unplugged

Chromium Embedding Framework

+ Desktop-Integration+ Standalone für Win/Mac/Lin+ einheitliche HTML/JS-Engine

- Installer notwendig- Build- und Konfigurationsskills

Dienstag, 11. Februar 14

Page 49: HTML5 unplugged

Firefox OS/Marketplace

Dienstag, 11. Februar 14

Page 50: HTML5 unplugged

Dienstag, 11. Februar 14

Page 51: HTML5 unplugged

Q&A

thanks for

listening

@marcbaechinger

Browsercoveragedaten: caniuse.com

Dienstag, 11. Februar 14

Page 52: HTML5 unplugged

Backup slides

Dienstag, 11. Februar 14

Page 53: HTML5 unplugged

815 5.11222Mobile Desktop WWW

Wsasx 0.0002%

Dienstag, 11. Februar 14

Page 54: HTML5 unplugged

feature testingDienstag, 11. Februar 14

Page 55: HTML5 unplugged

Sencha Desktop Packager

Dienstag, 11. Februar 14

Page 56: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

Dienstag, 11. Februar 14

Page 57: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

Dienstag, 11. Februar 14

Page 58: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

reload

Dienstag, 11. Februar 14

Page 59: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

reload

Dienstag, 11. Februar 14

Page 60: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

reloadreload

Dienstag, 11. Februar 14

Page 61: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

reloadreload

Dienstag, 11. Februar 14

Page 62: HTML5 unplugged

debug: serving file at: src/index.htmldebug: serving file at: src/sbb.appcachedebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap-responsive.cssdebug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpg

debug: serving file at: src/lib/jquery-1.8.2.jsdebug: serving file at: src/javascript/main.jsdebug: serving file at: src/img/train.jpgdebug: serving file at: src/css/style.cssdebug: serving file at: src/css/bootstrap.cssdebug: serving file at: src/css/bootstrap-responsive.css

debug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcachedebug: serving file at: src/sbb.appcache

server log

reloadreloadreload

Dienstag, 11. Februar 14

Page 63: HTML5 unplugged

The HTML(5) (r)evolution

Dienstag, 11. Februar 14

Page 64: HTML5 unplugged

• Standardisierung existierender, fortgeschrittener Browserfeatures

• Öffentlichkeitswirksame Promotion der Webtechnologie

• Google, Mozilla, Apple, Opera, Microsoft

• die Gunst der x-platform-Problematik nutzend

• von der Webpage zur Webapplication

• mobile is a game changer

HTML5 is a conspiracy theory!

Dienstag, 11. Februar 14

Page 65: HTML5 unplugged

JavaScript API werden Web Standards

JavaScript APIs

Dienstag, 11. Februar 14

Page 66: HTML5 unplugged

• box-sizing • border-radius• opacity• box-shadow, text-shadow• gradients

• transitions, animations (GPU support) • @media queries

• simplifizierte DOM-Struktur (tables must die!)• skalierbare, hi-res GUIs (no bitmaps)• Responsive Design

CSS3 - runde Ecken machen glücklich

Dienstag, 11. Februar 14

Page 67: HTML5 unplugged

<!DOCTYPE html>

http://www.html5rocks.com

Dienstag, 11. Februar 14

Page 68: HTML5 unplugged

Das Web wurde eine RIA Platform

• Browserkonvergenz auf hohem Niveau

• fortgeschrittener CSS Support

• Offline und Storage features

• Performance- und Reliability-Boost

• Vendor-Kooperation und Ökosystem

• Applikationen statt Websites (shift of mind)

• erprobte MVC-ArchitekturenDienstag, 11. Februar 14


Top Related