SlideShare a Scribd company logo
Mobile Development
      with HTML5



                      Hunter Loftis
                     @hunterloftis
              hunter@skookum.com
Hunter Loftis
• Director of Technology at Skookum DW
• JavaScript nerd
• (2001) Print illustration
• (2003) Flash animation
• (2004) Web design & development
• (2006) Web apps
• (2012) Mobile apps
grain of salt:


I’m not a mobile expert.
 I’m a JavaScript expert.
Status4: Golf
          gtggolf.com
  Realtime, distributed team
scoring on iPhone, Android, and
          Blackberry.
Mobile HTML5
  Open-Source
          github.com

        /madrobby/zepto
/hunterloftis/backbone.viewmodel
So?
Today, we’ll discuss and distill the
   lessons learned from these
    experiences into practical
  guidelines for building mobile
          HTML5 apps.
Mobile html5 v2
Mobile html5 v2
Mobile html5 v2
Before you jump in
   ask yourself three questions:
Can I build this natively?
• You know (or have time to learn) the
  language and APIs.
• You can target a single platform.
• You have the resources to support and
  maintain per-platform code bases.
• Your audience will commit to your app.
Why mobile HTML5?

• You are a front-end web expert (or team).
• Support for many current & future devices.
• Faster, cheaper dev cycles.
• Daily platform improvements for free.
• You accept the 50% performance penalty.
Mobile web, or hybrid?

• web: URLs, browser security model, and
  immediate deploys/updates
• hybrid: app stores, device security model,
  and gated deploys/updates
• you can do both, but it’s harder than you
  think.
Starting the app
    The easy parts
Quick Start
    https://github.com/skookum/mobilehtml5

         http://hunterloftis.com/mobile/

(demos are intentionally un-factored and verbose;
   apply proper engineering to real projects)
Install Stuff
• iPhone Simulators (xcode)
• Android SDK & debugging bridge:
• adb logcat browser:V *:S
1. Run offline


 2. Present this page
           as an app.
  3. Show icons and
     startup screens



 4. Prompt to install
to the home screen.
5 Minutes In
You have a container, now you
need content and functionality.
Building the app
    A survival guide
Do touch yourself.
ontouchstart, ontouchmove, ontouchend,
             ontouchcancel

          (soon in zepto.js)
Ignore standards and
    accessibility.
Debug on real devices.
iOS: settings > safari > developer > debug console:on
          Android: browser > “about:debug”
Forget jQuery.
Avoid frameworks.
Use alert().
And confirm() and prompt(). Seriously.
Learn microlibs
microjs.com, zepto.js, add2home, lawnchair, okay.js
Aim low.
Never use your iPhone.
Ignore feature
  detection.
     (usually)
Use specific forms.
       email, tel, url, date, number, range*
placeholder, autofocus, autocorrect, autocapitalize
Limit DOM updates.
Never animate with
    JavaScript.
Animate with CSS3
     (but only on iOS)
Assume you’re offline.
Store data locally
session storage, local storage, websql, indexed, lawnchair
Keep it async.
A RESTful JSON API over HTTPS is cool and full of
                  acronyms.
Embrace geolocation
 navigator.geolocation.getCurrentPosition()
   navigator.geolocation.watchPosition();
Protect your state.
Turn yourself off.
Link to phones & maps
       “maps.google.com/*”
       “tel: (704) 123-4567”
      “sms: (704) 234-5678”
And have fun!
•   Qs? @hunterloftis or hunter@skookum.com

•   slideshare.net/HunterLoftis/mobile-html5-v2

•   github.com/Skookum/mobilehtml5

•   github.com/hunterloftis/backbone.viewmodel

•   http://hunterloftis.com/mobile/

•   “Safari Web Content Guide”

•   http://microjs.com/

•   http://zeptojs.com/

More Related Content

What's hot (20)

PPT
How To Create One App For All Platforms using PhoneGap
MobiDev
 
KEY
TxJS 2011
Brian LeRoux
 
PPTX
GlueCon'11 - Native vs Wrapped Mobile apps : What to Build ?
Guilhem Ensuque
 
KEY
Phonegap 2.x
Brian LeRoux
 
PPTX
VDC Conference 2011 - Developing Cross-Platform Apps
Guilhem Ensuque
 
PDF
Cordova and PhoneGap Insights
Monaca
 
PPT
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
Guilhem Ensuque
 
PPTX
Building an app-like experience (without the app)
chaefele
 
KEY
Phonegap for Engineers
Brian LeRoux
 
PPTX
Phoenix Emulator PPT
Vineet Kumar
 
PPTX
Write Better JavaScript
Kevin Whinnery
 
PPTX
Lessons Learned From Applications That Kicked Titanium's Ass
Kevin Whinnery
 
PDF
Front-End Engineering 101
Milan Korsos
 
PPT
Multi-platform Mobile apps with Phonegap
Gautam Chaudhary
 
PDF
1人でも頑張れる!Retty式開発環境
Yoichiro Sakurai
 
PDF
Abilità Informatiche - Lezione 01 introduzione al corso
University of Catania
 
KEY
Js On Mobile Devices
Jens Arps
 
PPTX
Core java tutorials
TIB Academy
 
KEY
PhoneGap at Facebook Mobile Hack
PhoneGap
 
PPTX
Phone gap
caviare
 
How To Create One App For All Platforms using PhoneGap
MobiDev
 
TxJS 2011
Brian LeRoux
 
GlueCon'11 - Native vs Wrapped Mobile apps : What to Build ?
Guilhem Ensuque
 
Phonegap 2.x
Brian LeRoux
 
VDC Conference 2011 - Developing Cross-Platform Apps
Guilhem Ensuque
 
Cordova and PhoneGap Insights
Monaca
 
Create Cross-Platform Native Mobile Apps in Flex with ELIPS Studio
Guilhem Ensuque
 
Building an app-like experience (without the app)
chaefele
 
Phonegap for Engineers
Brian LeRoux
 
Phoenix Emulator PPT
Vineet Kumar
 
Write Better JavaScript
Kevin Whinnery
 
Lessons Learned From Applications That Kicked Titanium's Ass
Kevin Whinnery
 
Front-End Engineering 101
Milan Korsos
 
Multi-platform Mobile apps with Phonegap
Gautam Chaudhary
 
1人でも頑張れる!Retty式開発環境
Yoichiro Sakurai
 
Abilità Informatiche - Lezione 01 introduzione al corso
University of Catania
 
Js On Mobile Devices
Jens Arps
 
Core java tutorials
TIB Academy
 
PhoneGap at Facebook Mobile Hack
PhoneGap
 
Phone gap
caviare
 

Viewers also liked (15)

DOC
N E W S T U D Y O F G I T A N O V 12 D R
shriniwaskashalikar
 
DOC
N E W S T U D Y O F G I T A N O V 4 D R
shriniwaskashalikar
 
DOC
N A M A S M A R A N A N D S T R E S S D R
shriniwaskashalikar
 
DOC
P R A L H A D S A I D D R
shriniwaskashalikar
 
PDF
What Is 2010love
lsuter
 
PDF
Presentation 2010
worklight
 
PDF
SEO, LLC dba Www.Splinternet Marketing.Com Search Engine Rankings 6-28-2011
SEO, LLC dba www.SplinternetMarketing.com
 
PPT
Force
UKM
 
DOC
N I S H K A M A K A R M A D R
shriniwaskashalikar
 
PDF
93 percent-google-for-internet-marketing-services
SEO, LLC dba www.SplinternetMarketing.com
 
DOC
Diabetes Discussion Dr. Shriniwas Kashalikar
shriniwaskashalikar
 
DOC
New Study Of Gita Nov 11 Dr. Shriniwas J. Kashalikar
shriniwaskashalikar
 
PPS
世界奇特建築
Josephine C
 
DOC
Learning, Teaching And Superliving Dr. Shriniwas Kashalikar
shriniwaskashalikar
 
PDF
FlexNet Manager Suite Leverages Microsoft System Center to Deliver Next Gener...
Flexera
 
N E W S T U D Y O F G I T A N O V 12 D R
shriniwaskashalikar
 
N E W S T U D Y O F G I T A N O V 4 D R
shriniwaskashalikar
 
N A M A S M A R A N A N D S T R E S S D R
shriniwaskashalikar
 
P R A L H A D S A I D D R
shriniwaskashalikar
 
What Is 2010love
lsuter
 
Presentation 2010
worklight
 
SEO, LLC dba Www.Splinternet Marketing.Com Search Engine Rankings 6-28-2011
SEO, LLC dba www.SplinternetMarketing.com
 
Force
UKM
 
N I S H K A M A K A R M A D R
shriniwaskashalikar
 
93 percent-google-for-internet-marketing-services
SEO, LLC dba www.SplinternetMarketing.com
 
Diabetes Discussion Dr. Shriniwas Kashalikar
shriniwaskashalikar
 
New Study Of Gita Nov 11 Dr. Shriniwas J. Kashalikar
shriniwaskashalikar
 
世界奇特建築
Josephine C
 
Learning, Teaching And Superliving Dr. Shriniwas Kashalikar
shriniwaskashalikar
 
FlexNet Manager Suite Leverages Microsoft System Center to Deliver Next Gener...
Flexera
 
Ad

Similar to Mobile html5 v2 (20)

PPTX
HTML5: The Apps, the Frameworks, the Controversy
Apigee | Google Cloud
 
PDF
Pablo Villalba -
.toster
 
PPTX
Trip advsiorhybridpresentation
ElanaBoehm
 
PPTX
Building a real time html5 app for mobile devices
Tony Abou-Assaleh
 
PDF
Building native mobile apps using web technologies
Hjörtur Hilmarsson
 
PPTX
Native, HTML5 or Hybrid Mobile Apps - Cost vs benefits
Ranosys Technologies
 
PDF
AppsFuel, il nuovo marketplace per mobile web app e mobile site!
Mobile Web Italy Meetup
 
PPTX
Mobile native-hacks
DevelopmentArc LLC
 
PPTX
Introduction to jQueryMobile
Jeyakumaran Mayooresan
 
PPTX
2011 code camp
imranq2
 
PDF
Building mobile apps with PhoneGap and Backbone
Troy Miles
 
KEY
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
PPTX
Phone gap development, testing, and debugging
Kongu Engineering College, Perundurai, Erode
 
PDF
Hybridmobileapps 130130213844-phpapp02
weeyee
 
PDF
Html5 Architecture Early Release Wesley Hales
onyemaolaza
 
PDF
Lesson learned from 3 years with hybrid apps
Patrik Malmquist
 
PDF
Using HTML5 to Build Mobile Apps
Todd Anglin
 
PDF
HTML5 Can't Do That
Nathan Smith
 
PDF
Kinvey how-to-make-an-app-mobile-html5
Alok Sharma
 
PDF
Native, Web App, or Hybrid: Which Should You Choose?
Softweb Solutions
 
HTML5: The Apps, the Frameworks, the Controversy
Apigee | Google Cloud
 
Pablo Villalba -
.toster
 
Trip advsiorhybridpresentation
ElanaBoehm
 
Building a real time html5 app for mobile devices
Tony Abou-Assaleh
 
Building native mobile apps using web technologies
Hjörtur Hilmarsson
 
Native, HTML5 or Hybrid Mobile Apps - Cost vs benefits
Ranosys Technologies
 
AppsFuel, il nuovo marketplace per mobile web app e mobile site!
Mobile Web Italy Meetup
 
Mobile native-hacks
DevelopmentArc LLC
 
Introduction to jQueryMobile
Jeyakumaran Mayooresan
 
2011 code camp
imranq2
 
Building mobile apps with PhoneGap and Backbone
Troy Miles
 
HTML5 is the Future of Mobile, PhoneGap Takes You There Today
davyjones
 
Phone gap development, testing, and debugging
Kongu Engineering College, Perundurai, Erode
 
Hybridmobileapps 130130213844-phpapp02
weeyee
 
Html5 Architecture Early Release Wesley Hales
onyemaolaza
 
Lesson learned from 3 years with hybrid apps
Patrik Malmquist
 
Using HTML5 to Build Mobile Apps
Todd Anglin
 
HTML5 Can't Do That
Nathan Smith
 
Kinvey how-to-make-an-app-mobile-html5
Alok Sharma
 
Native, Web App, or Hybrid: Which Should You Choose?
Softweb Solutions
 
Ad

Recently uploaded (20)

PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
Designing Production-Ready AI Agents
Kunal Rai
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
July Patch Tuesday
Ivanti
 
Designing Production-Ready AI Agents
Kunal Rai
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Mobile html5 v2

Editor's Notes

  • #2: \n
  • #3: \n
  • #4: \n
  • #5: \n
  • #6: \n
  • #7: \n
  • #8: \n
  • #9: \n
  • #10: \n
  • #11: \n
  • #12: \n
  • #13: \n
  • #14: \n
  • #15: \n
  • #16: \n
  • #17: \n
  • #18: \n
  • #19: \n
  • #20: \n
  • #21: “tap” events are interpreted by the browser and have an inherent delay of ~300ms .. which makes your app feel slow and unresponsive.\n
  • #22: They don't matter (yet) on phones. It's hard enough to get something working; why design for an audience that doesn't even exist yet? For example:\nUse <div> instead of <a> (try both). You'll notice that on some phones, the <a> will still link after you interrupt it, and you have to prevent all of these defaults happening. Plus, since you'll be listening to the ontouchstart, you won't have a default to interrupt.\n\n
  • #23: Typical web dev + emulators and simulators + test devices\niOs: settings -> safari -> developer -> debug console: on\nAndroid: type about:debug in the URL bar (for most androids)\nset up the android crazy SDK bridge thing\n
  • #24: ...or any other cross-browser library. The vast majority of your audience (iOS, Android, Blackberry, Palm) renders via the webkit engine. Mobile devices are still relatively slow. Mobile browsers are still very slow and light on resources like memory. There's no excuse to drop heavy cross-browser libs like jQuery into the mix. (Android: 18%, iOS: 54%, Blackberry: 3%, total: 75% ... other 25% = Java ME & Symbian / old phones )\n\n
  • #25: They’re big, bloated, difficult to customize, and when you have problems with a control (or several controls) -- functionality, appearance, or compatibility with different devices -- there is very little you can do, and it’s typically a real headache to make significant updates since the frameworks have a high level of complexity.\n\nIf you don’t believe me, try the “kitchen sink” demo of jQuery mobile, Sencha touch, etc on a blackberry, an iPhone, and an old Android... and see what happens.\n\nNote: I haven’t tried the latest frameworks in several months, and I’m hopeful for progress.\n
  • #26: - rendered with native controls so they don’t make an impact on your app’s footprint\n- rendered and interacted with faster\n- feel native, consistent\n
  • #27: \n
  • #28: These days, most developers working with web apps aim high and gracefully degrade. We have turned to the "make it work on real browsers... safari... chrome... firefox... and then shim it for IE... workflow." We've gotten used to aiming for a great experience and providing fallbacks for anything that can't support it. Unfortunately, the mobile browser landscape is closer to 2006 than 2012. The majority of Android users are on the Android versions from 2010. Only 1% are on the latest OS. Hundreds of devices exist with different form factors, operating systems, browsers, CPUs, GPUs ... the way to stay sane is to aim low and progressively enhance for selected platforms (like iOS 5).\n\n
  • #29: If you're constantly testing with your iPhone, you'll be misled into the idea that things are working better than they really are. The iPhone set the golden standard for a mobile web browser, and it's still unchallenged. The latest version of Android with Chrome has edged closer, but it still falls short. Test with an Android on 2.2 to get the real picture. You can pick them up basically for free.\n
  • #30: Design your app offline first, then add network capability\ncache.manifest\nJS on app load to check and refresh cache if required\nMake it easy to disable offline caching (adds an extra layer of testing complexity)\n\n
  • #31: Controls the type of keyboard/interface that is presented\nCan get super annoying to have autocorrecting login for example\nProvides convenient characters (@ for email, / for url, etc)\n
  • #32: Repainting elements, adding, removing elements = super expensive operations on a phone.\n
  • #33: It’s incredibly slow on most phones, while CSS3 animations are GPU-accelerated on iOS.\n
  • #34: GPU accelerated on iOS. Not all Androids have GPUs or browser-based acceleration, so turn it off for everything else.\n
  • #35: Design your app offline first, then add network capability\ncache.manifest\nJS on app load to check and refresh cache if required\nMake it easy to disable offline caching (adds an extra layer of testing complexity)\n\n
  • #36: 5MB limit\n
  • #37: \n
  • #38: \n
  • #39: \n
  • #40: The first time we field-tested GTG, we (developers) were all confident that it worked, because we had been testing it on our iPhones, and doing occasional lab tests on our stock of Androids. 30 minutes into the 4-hour event, half of the phones were dead. All of the dead phones were Androids. Why? Android doesn't disable background processes - even web pages! - when the app is closed - or even when the phone is sleeping in your pocket! - so if you, for example, are polling Ajax (as we were), the phone's battery will just disappear. Later, we discovered that *some* Androids even restore old tabs immediately when the phone is restarted, meaning that until someone specifically turns off their phone, charges it, turns it back on, opens the browser and explicitly closes your tab... their phone will die over and over and over.\n\n
  • #41: \n
  • #42: \n
  • #43: \n