SlideShare a Scribd company logo
Get Ahead With HTML5
On Mobile

Markus Kobler
Overview
Offline Storage

Graphics

Networking

Tooling
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
1) Useable Today
1) Useable Today
1) Useable Today
1) Useable Today
2) Works Offline
3) Immersive & Engaging
4) No Permission Needed
5) Evolving Fast
Simple Sudoku Demo
j.mp/sudokuapp
Simple Sudoku Demo
j.mp/sudokuapp
Offline Storage
AppCache very simple to add...

1) List all your resources in a manifest file
AppCache very simple to add...

1) List all your resources in a manifest file




2) Reference your manifest file in the <html> tag
Get Ahead with HTML5 on Moible
Get Ahead with HTML5 on Moible
Update Manifest file EVERY time ANY required resource changes
Update Manifest file EVERY time ANY required resource changes

If resources fail to download, app will not update!
Update Manifest file EVERY time ANY required resource changes

 If resources fail to download, app will not update!

 Your old version will always start first
   (Browser does not know if it has a connection initially)

window.applicationCache.addEventListener('updateready', function(e) {
  if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {
      window.applicationCache.swapCache();
      window.location.reload();
  }
}, false);
Web Storage
 A Simple Key/Value store for strings
                  localStorage.setItem("bar", foo);

                  localStorage["bar"] = foo;
Web Storage
 A Simple Key/Value store for strings
                  localStorage.setItem("bar", foo);

                  localStorage["bar"] = foo;


 But nothing to stop you from encoding JSON, image data, etc
Web Storage
 A Simple Key/Value store for strings
                   localStorage.setItem("bar", foo);

                   localStorage["bar"] = foo;


 But nothing to stop you from encoding JSON, image data, etc




 Tied to a browser session or longer (similar to cookies)
Web SQL Database
  Power of a client side RDBS
  var db = openDatabase('example', '1.0', 'Checkins', 8192);
  db.transaction(function(tx) {
    tx.executeSql("create table if not exists " +
       "checkins(id integer primary key asc, time integer, latitude float,longitude float)"
    );
  });

  db.transaction(function(tx) {
    tx.executeSql(
       "insert into checkins (time, latitude, longitude) values (?,?,?);",
       [checkin.time, checkin.latitude, checkin.longitude],
       onSuccessHandler, onErrorHandler
    );
  });
Web SQL Database
  Power of a client side RDBS
  var db = openDatabase('example', '1.0', 'Checkins', 8192);
  db.transaction(function(tx) {
    tx.executeSql("create table if not exists " +
       "checkins(id integer primary key asc, time integer, latitude float,longitude float)"
    );
  });

  db.transaction(function(tx) {
    tx.executeSql(
       "insert into checkins (time, latitude, longitude) values (?,?,?);",
       [checkin.time, checkin.latitude, checkin.longitude],
       onSuccessHandler, onErrorHandler
    );
  });



  That’s both good and bad
Web SQL Database
  Power of a client side RDBS
  var db = openDatabase('example', '1.0', 'Checkins', 8192);
  db.transaction(function(tx) {
    tx.executeSql("create table if not exists " +
       "checkins(id integer primary key asc, time integer, latitude float,longitude float)"
    );
  });

  db.transaction(function(tx) {
    tx.executeSql(
       "insert into checkins (time, latitude, longitude) values (?,?,?);",
       [checkin.time, checkin.latitude, checkin.longitude],
       onSuccessHandler, onErrorHandler
    );
  });



  That’s both good and bad
  Effectively a JavaScript wrapper around SQLite...
Get Ahead with HTML5 on Moible
Web DB set to be replaced

          New initiative around IndexedDB

          An indexed object store instead of
          SQL

          Early implementations in Chrome &
          Firefox

          But no support on mobile yet...
Graphics
Bling
Web’s performance is getting quicker every day
If you still need convincing check out

            http://ro.me/

And other demos at www.chromeexperiments.com
Range of technologies to choose from

  CSS3
  - Mostly well supported and might get you a long way
Range of technologies to choose from

  CSS3
  - Mostly well supported and might get you a long way

  Canvas and SVG
  - Canvas is great for pixel perfect changes
  - SVG if vectors are a better fit
Range of technologies to choose from

  CSS3
  - Mostly well supported and might get you a long way

  Canvas and SVG
  - Canvas is great for pixel perfect changes
  - SVG if vectors are a better fit

  WebGL
  - Not there yet for mobiles and tablets but coming soon...
Think carefully about how you build your app
    Avoid excessive browser reflows wherever possible
Think carefully about how you build your app
    Avoid excessive browser reflows wherever possible
Think carefully about how you build your app
    Avoid excessive browser reflows wherever possible


    Avoid using setTimeout() loops
   - Use requestAnimationFrame() instead
Think carefully about how you build your app
    Avoid excessive browser reflows wherever possible


    Avoid using setTimeout() loops
   - Use requestAnimationFrame() instead

    3D CSS transforms can speed up Desktop/iOS apps but
    Android still has poor support
Think carefully about how you build your app
    Avoid excessive browser reflows wherever possible


    Avoid using setTimeout() loops
   - Use requestAnimationFrame() instead

    3D CSS transforms can speed up Desktop/iOS apps but
    Android still has poor support


               Check out Paul Irish’s great blog posts for more info
           http://paulirish.com/2011/dom-html5-css3-performance/
Network Effects
Get Ahead with HTML5 on Moible
Websocket Demo
Tooling
Get Ahead with HTML5 on Moible
Familiar syntax for web developers

Built on top of jQuery

Provides useful mobile widgets

It might be all you need...
Familiar syntax for web developers

           Built on top of jQuery

           Provides useful mobile widgets

           It might be all you need...

complex apps typically demand more
Get Ahead with HTML5 on Moible
Sencha Touch                      SproutCore
- Both modern Open Source projects
- Designed with pure JS mobile apps in mind
- Backed by two well financed startups
Google Web Toolkit

   Java (& XML) at core

   Mature and fully featured

   Works well with teams of Dev’s

   Aggressively optimised

   But will not be to everyone’s taste
Summing up
HTML5 is still a bit of a jungle...




                 Tropic Thunder © 2008 DreamWorks Pictures
...all new technologies can cause initial pain




                                     Tropic Thunder © 2008 DreamWorks Pictures
Don’t forget to test throughout the development process
and on as many platforms as possible
It’s never been a better
It’s never been a better
time to get started
Thank you for listening

Feedback appreciated
@markuskobler




distinctive.co
Useful Links
    Spec’s
     - http://www.whatwg.org/specs/web-apps/current-work/multipage/
     - http://www.w3.org/TR/html5/offline.html
     - http://www.w3.org/TR/webstorage/
     - http://www.w3.org/TR/IndexedDB/
     - http://www.w3.org/TR/websockets/

    Frameworks
     - http://jquerymobile.com/
     - http://www.sencha.com/products/touch/
     - http://www.sproutcore.com/
     - http://code.google.com/webtoolkit/

    Useful Links
     - http://www.html5rocks.com/
     - http://caniuse.com/
     - http://html5demos.com/
     - http://www.browserscope.org/
Image Credits

  Annie Mole - http://www.flickr.com/photos/anniemole/2424372024/sizes/l/in/photostream/
  Yaniv Golan - http://www.flickr.com/photos/yghelloworld/4964999147/sizes/l/in/photostream/
  Achew *Bokehmon* - http://www.flickr.com/photos/achew/3987039984/in/photostream/
  Liam Johnson - http://www.flickr.com/photos/livelavalove/4899123302/sizes/l/in/photostream/
  Cdevers - http://www.flickr.com/photos/cdevers/4602805654/sizes/l/in/photostream/
  Melvin Schlubman - http://www.flickr.com/photos/pauldineen/4871132100/sizes/l/in/photostream/
  Melvin Schlubman - http://www.flickr.com/photos/pauldineen/4871130172/in/photostream/
  Afagen - http://www.flickr.com/photos/afagen/4913607219/sizes/l/in/photostream/
  Langley Research Center - Nasa http://grin.hq.nasa.gov/ABSTRACTS/GPN-2000-001907.html
  Ming Xia - http://www.flickr.com/photos/xiaming/476229544/

More Related Content

PDF
High Performance JavaScript - jQuery Conference SF Bay Area 2010
PPT
Ajax Performance
PDF
React & The Art of Managing Complexity
PDF
APIs for modern web apps
PDF
High Performance JavaScript - WebDirections USA 2010
PDF
APIs, now and in the future
PDF
Web versus Native: round 1!
PDF
Our application got popular and now it breaks
High Performance JavaScript - jQuery Conference SF Bay Area 2010
Ajax Performance
React & The Art of Managing Complexity
APIs for modern web apps
High Performance JavaScript - WebDirections USA 2010
APIs, now and in the future
Web versus Native: round 1!
Our application got popular and now it breaks

What's hot (20)

KEY
HTML5 vs Silverlight
PDF
Empowering the "mobile web"
PDF
Instant and offline apps with Service Worker
PDF
Node.js & Twitter Bootstrap Crash Course
PPTX
High Performance JavaScript (CapitolJS 2011)
PDF
Webpack packing it all
PDF
Web Development with NodeJS
PDF
The Future of CSS with Web Components
PDF
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
PDF
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
PDF
PWA 與 Service Worker
PDF
Node.js Crash Course
PDF
Going Node At Netflix
PPTX
What is HTML 5?
PDF
Developing for Mobile
PDF
Building a JavaScript Library
PDF
Don't make me wait! or Building High-Performance Web Applications
PDF
PWA 應用 - 實現網站離線瀏覽
PDF
Introduction to Node.js
PDF
Using Web Standards to create Interactive Data Visualizations for the Web
HTML5 vs Silverlight
Empowering the "mobile web"
Instant and offline apps with Service Worker
Node.js & Twitter Bootstrap Crash Course
High Performance JavaScript (CapitolJS 2011)
Webpack packing it all
Web Development with NodeJS
The Future of CSS with Web Components
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
PWA 與 Service Worker
Node.js Crash Course
Going Node At Netflix
What is HTML 5?
Developing for Mobile
Building a JavaScript Library
Don't make me wait! or Building High-Performance Web Applications
PWA 應用 - 實現網站離線瀏覽
Introduction to Node.js
Using Web Standards to create Interactive Data Visualizations for the Web
Ad

Viewers also liked (10)

DOCX
Yeah
PDF
Avoiding Technical Bankruptcy
PPTX
D:\mis documentos\trabajo de imformatica por javi gu
PPT
PPT
Buyback Refresher
PDF
Five lessons
DOCX
Usher
PPT
Meeting Presentation
PPT
Microformats
PDF
Content marketing-playbook
Yeah
Avoiding Technical Bankruptcy
D:\mis documentos\trabajo de imformatica por javi gu
Buyback Refresher
Five lessons
Usher
Meeting Presentation
Microformats
Content marketing-playbook
Ad

Similar to Get Ahead with HTML5 on Moible (20)

PDF
Html5 storage suggestions for challenges.pptx
PDF
Naked and afraid Offline Mobile
PDF
Naked and afraid Offline mobile
PPTX
Notes on SF W3Conf
PDF
Mobile App Development
PPTX
HTML5 on Mobile
PPTX
In-browser storage and me
PDF
Local Storage for Web Applications
KEY
HTML5와 모바일
PDF
The Mobile Web - HTML5 on mobile devices
PDF
Building great mobile apps: Somethings you might want to know
KEY
PDF
Optimizing for Change (Henrik Joreteg)
PDF
HTML5 and the dawn of rich mobile web applications pt 1
PDF
Building cross platform mobile web apps
PDF
your browser, my storage
PDF
The Enterprise Dilemma: Native vs. Web
PPT
HTML5 Data Storage
PDF
Mobile Web Development with HTML5
PDF
HTML5: the new frontier of the web
Html5 storage suggestions for challenges.pptx
Naked and afraid Offline Mobile
Naked and afraid Offline mobile
Notes on SF W3Conf
Mobile App Development
HTML5 on Mobile
In-browser storage and me
Local Storage for Web Applications
HTML5와 모바일
The Mobile Web - HTML5 on mobile devices
Building great mobile apps: Somethings you might want to know
Optimizing for Change (Henrik Joreteg)
HTML5 and the dawn of rich mobile web applications pt 1
Building cross platform mobile web apps
your browser, my storage
The Enterprise Dilemma: Native vs. Web
HTML5 Data Storage
Mobile Web Development with HTML5
HTML5: the new frontier of the web

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Digital-Transformation-Roadmap-for-Companies.pptx
20250228 LYD VKU AI Blended-Learning.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Building Integrated photovoltaic BIPV_UPV.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Dropbox Q2 2025 Financial Results & Investor Presentation
“AI and Expert System Decision Support & Business Intelligence Systems”

Get Ahead with HTML5 on Moible

  • 1. Get Ahead With HTML5 On Mobile Markus Kobler
  • 10. 3) Immersive & Engaging
  • 16. AppCache very simple to add... 1) List all your resources in a manifest file
  • 17. AppCache very simple to add... 1) List all your resources in a manifest file 2) Reference your manifest file in the <html> tag
  • 20. Update Manifest file EVERY time ANY required resource changes
  • 21. Update Manifest file EVERY time ANY required resource changes If resources fail to download, app will not update!
  • 22. Update Manifest file EVERY time ANY required resource changes If resources fail to download, app will not update! Your old version will always start first (Browser does not know if it has a connection initially) window.applicationCache.addEventListener('updateready', function(e) { if (window.applicationCache.status == window.applicationCache.UPDATEREADY) {       window.applicationCache.swapCache(); window.location.reload();   } }, false);
  • 23. Web Storage A Simple Key/Value store for strings localStorage.setItem("bar", foo); localStorage["bar"] = foo;
  • 24. Web Storage A Simple Key/Value store for strings localStorage.setItem("bar", foo); localStorage["bar"] = foo; But nothing to stop you from encoding JSON, image data, etc
  • 25. Web Storage A Simple Key/Value store for strings localStorage.setItem("bar", foo); localStorage["bar"] = foo; But nothing to stop you from encoding JSON, image data, etc Tied to a browser session or longer (similar to cookies)
  • 26. Web SQL Database Power of a client side RDBS var db = openDatabase('example', '1.0', 'Checkins', 8192); db.transaction(function(tx) { tx.executeSql("create table if not exists " + "checkins(id integer primary key asc, time integer, latitude float,longitude float)" ); }); db.transaction(function(tx) { tx.executeSql( "insert into checkins (time, latitude, longitude) values (?,?,?);", [checkin.time, checkin.latitude, checkin.longitude], onSuccessHandler, onErrorHandler ); });
  • 27. Web SQL Database Power of a client side RDBS var db = openDatabase('example', '1.0', 'Checkins', 8192); db.transaction(function(tx) { tx.executeSql("create table if not exists " + "checkins(id integer primary key asc, time integer, latitude float,longitude float)" ); }); db.transaction(function(tx) { tx.executeSql( "insert into checkins (time, latitude, longitude) values (?,?,?);", [checkin.time, checkin.latitude, checkin.longitude], onSuccessHandler, onErrorHandler ); }); That’s both good and bad
  • 28. Web SQL Database Power of a client side RDBS var db = openDatabase('example', '1.0', 'Checkins', 8192); db.transaction(function(tx) { tx.executeSql("create table if not exists " + "checkins(id integer primary key asc, time integer, latitude float,longitude float)" ); }); db.transaction(function(tx) { tx.executeSql( "insert into checkins (time, latitude, longitude) values (?,?,?);", [checkin.time, checkin.latitude, checkin.longitude], onSuccessHandler, onErrorHandler ); }); That’s both good and bad Effectively a JavaScript wrapper around SQLite...
  • 30. Web DB set to be replaced New initiative around IndexedDB An indexed object store instead of SQL Early implementations in Chrome & Firefox But no support on mobile yet...
  • 32. Bling
  • 33. Web’s performance is getting quicker every day
  • 34. If you still need convincing check out http://ro.me/ And other demos at www.chromeexperiments.com
  • 35. Range of technologies to choose from CSS3 - Mostly well supported and might get you a long way
  • 36. Range of technologies to choose from CSS3 - Mostly well supported and might get you a long way Canvas and SVG - Canvas is great for pixel perfect changes - SVG if vectors are a better fit
  • 37. Range of technologies to choose from CSS3 - Mostly well supported and might get you a long way Canvas and SVG - Canvas is great for pixel perfect changes - SVG if vectors are a better fit WebGL - Not there yet for mobiles and tablets but coming soon...
  • 38. Think carefully about how you build your app Avoid excessive browser reflows wherever possible
  • 39. Think carefully about how you build your app Avoid excessive browser reflows wherever possible
  • 40. Think carefully about how you build your app Avoid excessive browser reflows wherever possible Avoid using setTimeout() loops - Use requestAnimationFrame() instead
  • 41. Think carefully about how you build your app Avoid excessive browser reflows wherever possible Avoid using setTimeout() loops - Use requestAnimationFrame() instead 3D CSS transforms can speed up Desktop/iOS apps but Android still has poor support
  • 42. Think carefully about how you build your app Avoid excessive browser reflows wherever possible Avoid using setTimeout() loops - Use requestAnimationFrame() instead 3D CSS transforms can speed up Desktop/iOS apps but Android still has poor support Check out Paul Irish’s great blog posts for more info http://paulirish.com/2011/dom-html5-css3-performance/
  • 48. Familiar syntax for web developers Built on top of jQuery Provides useful mobile widgets It might be all you need...
  • 49. Familiar syntax for web developers Built on top of jQuery Provides useful mobile widgets It might be all you need... complex apps typically demand more
  • 51. Sencha Touch SproutCore - Both modern Open Source projects - Designed with pure JS mobile apps in mind - Backed by two well financed startups
  • 52. Google Web Toolkit Java (& XML) at core Mature and fully featured Works well with teams of Dev’s Aggressively optimised But will not be to everyone’s taste
  • 54. HTML5 is still a bit of a jungle... Tropic Thunder © 2008 DreamWorks Pictures
  • 55. ...all new technologies can cause initial pain Tropic Thunder © 2008 DreamWorks Pictures
  • 56. Don’t forget to test throughout the development process
  • 57. and on as many platforms as possible
  • 58. It’s never been a better
  • 59. It’s never been a better time to get started
  • 60. Thank you for listening Feedback appreciated @markuskobler distinctive.co
  • 61. Useful Links Spec’s - http://www.whatwg.org/specs/web-apps/current-work/multipage/ - http://www.w3.org/TR/html5/offline.html - http://www.w3.org/TR/webstorage/ - http://www.w3.org/TR/IndexedDB/ - http://www.w3.org/TR/websockets/ Frameworks - http://jquerymobile.com/ - http://www.sencha.com/products/touch/ - http://www.sproutcore.com/ - http://code.google.com/webtoolkit/ Useful Links - http://www.html5rocks.com/ - http://caniuse.com/ - http://html5demos.com/ - http://www.browserscope.org/
  • 62. Image Credits Annie Mole - http://www.flickr.com/photos/anniemole/2424372024/sizes/l/in/photostream/ Yaniv Golan - http://www.flickr.com/photos/yghelloworld/4964999147/sizes/l/in/photostream/ Achew *Bokehmon* - http://www.flickr.com/photos/achew/3987039984/in/photostream/ Liam Johnson - http://www.flickr.com/photos/livelavalove/4899123302/sizes/l/in/photostream/ Cdevers - http://www.flickr.com/photos/cdevers/4602805654/sizes/l/in/photostream/ Melvin Schlubman - http://www.flickr.com/photos/pauldineen/4871132100/sizes/l/in/photostream/ Melvin Schlubman - http://www.flickr.com/photos/pauldineen/4871130172/in/photostream/ Afagen - http://www.flickr.com/photos/afagen/4913607219/sizes/l/in/photostream/ Langley Research Center - Nasa http://grin.hq.nasa.gov/ABSTRACTS/GPN-2000-001907.html Ming Xia - http://www.flickr.com/photos/xiaming/476229544/