SlideShare a Scribd company logo
1 of 20
Getting the Native Feel
 JavaScript for Mobile and Tablet HTML5 Apps



                      Bill Fisher
                   @fisherwebdev
               bill.hotstudiodev.com
overview
• HTML5 Apps vs. Native Apps
• Touchy: a jQuery plugin for touch events
• Get accelerated: js optimization + css
  animations
• Further considerations
iLose
• expensive to build for multiple platforms
• app store fees and rules
• loss of control over customer data
• no control over distribution channel and
  promotion/marketing issues
Financial Times
• Built by Assanka. Raises the bar.
• Use of HTML5 technologies and hacks to achieve
  an optimal user experience
• User promptedlocalsave to homescreen and to
  allow 50mb of
                 to
                     storage
• Last week: Financial Times kicked out of App Store
• Presentation on how they built it: http://
  vimeo.com/26604635
Hot Studio
• Recent work has been geared toward
  mobile or tablet
• Application frameworks like Sencha Touch
  or jQuery Mobile are too heavy-handed
• Need good control over the touch
  “environment”
touch event libraries

• touchscroll.js
• iscroll-4
• JSGestureRecognizer
• touchy - github.com/HotStudio/touchy
touchy: a jQuery plugin
• layered on top of ontouchstart, ontouchmove and
  ontouchend
• loosely based on native iOS gesture recognizers:
  drag, swipe, pinch, rotate, longpress
• architecture based on Ben Alman’s jQuery special
  events article
• event handlers receive the “phase” of the event in
  a parameter, in addition to other data
using touchy
Example #1
var handleTouchyPinch = function (e, $target, data) {
   $target.css('webkitTransform','scale(' + data.scale + ',' + data.scale + ')');
};
$('#my_div').bind('touchy-pinch', handleTouchyPinch);



Example #2
var degrees = 0,
   handleTouchyRotate = function (e, phase, $target, data) {

    if (phase === 'move') {

    
     degrees += data.degreeDelta;

    
     $target.css('webkitTransform','rotate3d(0,0,0,'+ degrees +'deg)');

    }
};
$('#my_div').bind('touchy-rotate', handleTouchyRotate);
event handlers: use css3

• Use 3D CSS for hardware acceleration
• *-transform: translateZ(0) or translate3d(0,0,0)

    hardware acceleration debugging:
    $ CA_COLOR_OPAQUE=1 /Developer/Platforms/iPhoneSimulator.platform/
    Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone
    Simulator
event handlers: javascript
• throttled frame rates
• name anonymous functions so they may be
  profiled
• separate reading and modifying of DOM values
  into two distinct phases of operation
things to avoid

• DOM manipulation: hit the DOM once
• accidental browser layout reflow
• animated css shadows and gradients
example uses of js + css3

 • HTML5 Rocks
 • http://desandro.com/
 • Touchy examples
further considerations
• base64 encoded images
• requestAnimationFrame
• offline use: save to homescreen + cache
  manifest + local storage
• W3C widgets
FTW
• build and advocate for optimized HTML5 apps
• create and contribute to open source projects
  that make development easier
• dream big and push the limits!
• open systems will win
Links: HTML5 Apps
HTML5 Apps vs. Native Apps
http://www.readwriteweb.com/mobile/2011/08/android-users-prefer-native-ov.php
http://www.mobiletech.mobi/blog/mobile-web-vs-native-apps-revisited/11672/
http://www.readwriteweb.com/archives/mobile_app_or_browser-based_site.php
http://www.readwriteweb.com/archives/web_vs_native_mobile_app_forrester_says_do_both.php


Financial Times HTML5 App
http://vimeo.com/26604635
http://www.ft.com/
Links: Touch
Touch Events and Touchy jQuery Plugin
https://github.com/HotStudio/touchy
https://github.com/davidaurelio/TouchScroll
https://github.com/mud/jsgesturerecognizer
https://github.com/cubiq/iscroll

developer.apple.com:
http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/HandlingEvents/HandlingEvents.html
http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/
http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/GestureEventClassReference/
Links: CSS3 and Perf
CSS3 Transforms and Animations
http://www.webkit.org/blog/386/3d-transforms/
http://desandro.github.com/3dtransforms/
http://www.html5rocks.com/en/tutorials/3d/css/
http://www.joelambert.co.uk/cssa/


Browser Optimization
http://paulirish.com/2011/dom-html5-css3-performance/
http://www.html5rocks.com/en/tutorials/speed/html5/
http://mir.aculo.us/2011/02/08/visualizing-webkits-hardware-acceleration/
http://calendar.perfplanet.com/2009/rendering-repaint-reflow-relayout-restyle/
http://www.slideshare.net/madrobby/extreme-javascript-performance
Thanks!
bill.hotstudiodev.com

More Related Content

What's hot

Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsTim Wright
 
Cinematic Interactives with Animate CC
Cinematic Interactives with Animate CCCinematic Interactives with Animate CC
Cinematic Interactives with Animate CCJoseph Labrecque
 
Cross Platform Mobile Development
Cross Platform Mobile DevelopmentCross Platform Mobile Development
Cross Platform Mobile DevelopmentManesh Lad
 
Appurify - Runtime Debugging, Performance Optimization and Automated CI
Appurify - Runtime Debugging, Performance Optimization and Automated CIAppurify - Runtime Debugging, Performance Optimization and Automated CI
Appurify - Runtime Debugging, Performance Optimization and Automated CIManish Lachwani
 
CC 2015 Single Page Applications for the ASPNET Developer
CC 2015   Single Page Applications for the ASPNET DeveloperCC 2015   Single Page Applications for the ASPNET Developer
CC 2015 Single Page Applications for the ASPNET DeveloperAllen Conway
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in ComponentsFITC
 
Marionette structure with modules
Marionette structure with modulesMarionette structure with modules
Marionette structure with modulesmatt-briggs
 
CA Plex on Apple Mac, iOS, Android
CA Plex on Apple Mac, iOS, AndroidCA Plex on Apple Mac, iOS, Android
CA Plex on Apple Mac, iOS, AndroidCM First Group
 
Mobilizing Your Visualforce Application With JQuery and KnockoutJS
Mobilizing Your Visualforce Application With JQuery and KnockoutJSMobilizing Your Visualforce Application With JQuery and KnockoutJS
Mobilizing Your Visualforce Application With JQuery and KnockoutJSSalesforce Developers
 

What's hot (13)

Practical html5
Practical html5Practical html5
Practical html5
 
Native Device vs. Mobile Web Applications
Native Device vs. Mobile Web ApplicationsNative Device vs. Mobile Web Applications
Native Device vs. Mobile Web Applications
 
2014 Picking a Platform by Anand Kulkarni
2014 Picking a Platform by Anand Kulkarni2014 Picking a Platform by Anand Kulkarni
2014 Picking a Platform by Anand Kulkarni
 
Cinematic Interactives with Animate CC
Cinematic Interactives with Animate CCCinematic Interactives with Animate CC
Cinematic Interactives with Animate CC
 
Cross Platform Mobile Development
Cross Platform Mobile DevelopmentCross Platform Mobile Development
Cross Platform Mobile Development
 
Appurify - Runtime Debugging, Performance Optimization and Automated CI
Appurify - Runtime Debugging, Performance Optimization and Automated CIAppurify - Runtime Debugging, Performance Optimization and Automated CI
Appurify - Runtime Debugging, Performance Optimization and Automated CI
 
CC 2015 Single Page Applications for the ASPNET Developer
CC 2015   Single Page Applications for the ASPNET DeveloperCC 2015   Single Page Applications for the ASPNET Developer
CC 2015 Single Page Applications for the ASPNET Developer
 
Thinking in Components
Thinking in ComponentsThinking in Components
Thinking in Components
 
Marionette structure with modules
Marionette structure with modulesMarionette structure with modules
Marionette structure with modules
 
CA Plex on Apple Mac, iOS, Android
CA Plex on Apple Mac, iOS, AndroidCA Plex on Apple Mac, iOS, Android
CA Plex on Apple Mac, iOS, Android
 
Mobilizing Your Visualforce Application With JQuery and KnockoutJS
Mobilizing Your Visualforce Application With JQuery and KnockoutJSMobilizing Your Visualforce Application With JQuery and KnockoutJS
Mobilizing Your Visualforce Application With JQuery and KnockoutJS
 
Progressive Web Apps are here!
Progressive Web Apps are here!Progressive Web Apps are here!
Progressive Web Apps are here!
 
Jquery
JqueryJquery
Jquery
 

Similar to Getting the-native-feel

Mobile web or native app
Mobile web or native appMobile web or native app
Mobile web or native appMike Takahashi
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Nuxeo
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevMihail Mateev
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. ToolboxWojtek Zając
 
Desarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webDesarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webSoftware Guru
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleyn_adam_stanley
 
Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Thinkful
 
Html5 today
Html5 todayHtml5 today
Html5 todayRoy Yu
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadRuss Fustino
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesWesley Hales
 
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appThings I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appLim Chee Aun
 
Responsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawResponsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawMeet Magento Spain
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1Teamstudio
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressDanilo Ercoli
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGGDBologna
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)Jia Mi
 

Similar to Getting the-native-feel (20)

Mobile web or native app
Mobile web or native appMobile web or native app
Mobile web or native app
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011Mobile ECM with JavaScript - JSE 2011
Mobile ECM with JavaScript - JSE 2011
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateev
 
Responsive websites. Toolbox
Responsive websites. ToolboxResponsive websites. Toolbox
Responsive websites. Toolbox
 
Desarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías webDesarrollo de apps multiplataforma con tecnologías web
Desarrollo de apps multiplataforma con tecnologías web
 
Sg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanleySg conference multiplatform_apps_adam_stanley
Sg conference multiplatform_apps_adam_stanley
 
Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)Web app with j query & javascript (5:4)
Web app with j query & javascript (5:4)
 
AppNotch
AppNotchAppNotch
AppNotch
 
Html5 today
Html5 todayHtml5 today
Html5 today
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
 
The Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devicesThe Mobile Web - HTML5 on mobile devices
The Mobile Web - HTML5 on mobile devices
 
Things I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web appThings I've learnt from my Hacker News web app
Things I've learnt from my Hacker News web app
 
Responsive Web Design - Tom Robertshaw
Responsive Web Design - Tom RobertshawResponsive Web Design - Tom Robertshaw
Responsive Web Design - Tom Robertshaw
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
 
Mobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPressMobile Hybrid Development with WordPress
Mobile Hybrid Development with WordPress
 
GeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPressGeneralMobile Hybrid Development with WordPress
GeneralMobile Hybrid Development with WordPress
 
DjangoSki
DjangoSkiDjangoSki
DjangoSki
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
Future of Mobile
Future of MobileFuture of Mobile
Future of Mobile
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

Getting the-native-feel

  • 1. Getting the Native Feel JavaScript for Mobile and Tablet HTML5 Apps Bill Fisher @fisherwebdev bill.hotstudiodev.com
  • 2. overview • HTML5 Apps vs. Native Apps • Touchy: a jQuery plugin for touch events • Get accelerated: js optimization + css animations • Further considerations
  • 3. iLose • expensive to build for multiple platforms • app store fees and rules • loss of control over customer data • no control over distribution channel and promotion/marketing issues
  • 4.
  • 5.
  • 6. Financial Times • Built by Assanka. Raises the bar. • Use of HTML5 technologies and hacks to achieve an optimal user experience • User promptedlocalsave to homescreen and to allow 50mb of to storage • Last week: Financial Times kicked out of App Store • Presentation on how they built it: http:// vimeo.com/26604635
  • 7. Hot Studio • Recent work has been geared toward mobile or tablet • Application frameworks like Sencha Touch or jQuery Mobile are too heavy-handed • Need good control over the touch “environment”
  • 8. touch event libraries • touchscroll.js • iscroll-4 • JSGestureRecognizer • touchy - github.com/HotStudio/touchy
  • 9. touchy: a jQuery plugin • layered on top of ontouchstart, ontouchmove and ontouchend • loosely based on native iOS gesture recognizers: drag, swipe, pinch, rotate, longpress • architecture based on Ben Alman’s jQuery special events article • event handlers receive the “phase” of the event in a parameter, in addition to other data
  • 10. using touchy Example #1 var handleTouchyPinch = function (e, $target, data) { $target.css('webkitTransform','scale(' + data.scale + ',' + data.scale + ')'); }; $('#my_div').bind('touchy-pinch', handleTouchyPinch); Example #2 var degrees = 0, handleTouchyRotate = function (e, phase, $target, data) { if (phase === 'move') { degrees += data.degreeDelta; $target.css('webkitTransform','rotate3d(0,0,0,'+ degrees +'deg)'); } }; $('#my_div').bind('touchy-rotate', handleTouchyRotate);
  • 11. event handlers: use css3 • Use 3D CSS for hardware acceleration • *-transform: translateZ(0) or translate3d(0,0,0) hardware acceleration debugging: $ CA_COLOR_OPAQUE=1 /Developer/Platforms/iPhoneSimulator.platform/ Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator
  • 12. event handlers: javascript • throttled frame rates • name anonymous functions so they may be profiled • separate reading and modifying of DOM values into two distinct phases of operation
  • 13. things to avoid • DOM manipulation: hit the DOM once • accidental browser layout reflow • animated css shadows and gradients
  • 14. example uses of js + css3 • HTML5 Rocks • http://desandro.com/ • Touchy examples
  • 15. further considerations • base64 encoded images • requestAnimationFrame • offline use: save to homescreen + cache manifest + local storage • W3C widgets
  • 16. FTW • build and advocate for optimized HTML5 apps • create and contribute to open source projects that make development easier • dream big and push the limits! • open systems will win
  • 17. Links: HTML5 Apps HTML5 Apps vs. Native Apps http://www.readwriteweb.com/mobile/2011/08/android-users-prefer-native-ov.php http://www.mobiletech.mobi/blog/mobile-web-vs-native-apps-revisited/11672/ http://www.readwriteweb.com/archives/mobile_app_or_browser-based_site.php http://www.readwriteweb.com/archives/web_vs_native_mobile_app_forrester_says_do_both.php Financial Times HTML5 App http://vimeo.com/26604635 http://www.ft.com/
  • 18. Links: Touch Touch Events and Touchy jQuery Plugin https://github.com/HotStudio/touchy https://github.com/davidaurelio/TouchScroll https://github.com/mud/jsgesturerecognizer https://github.com/cubiq/iscroll developer.apple.com: http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/HandlingEvents/HandlingEvents.html http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/ http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/GestureEventClassReference/
  • 19. Links: CSS3 and Perf CSS3 Transforms and Animations http://www.webkit.org/blog/386/3d-transforms/ http://desandro.github.com/3dtransforms/ http://www.html5rocks.com/en/tutorials/3d/css/ http://www.joelambert.co.uk/cssa/ Browser Optimization http://paulirish.com/2011/dom-html5-css3-performance/ http://www.html5rocks.com/en/tutorials/speed/html5/ http://mir.aculo.us/2011/02/08/visualizing-webkits-hardware-acceleration/ http://calendar.perfplanet.com/2009/rendering-repaint-reflow-relayout-restyle/ http://www.slideshare.net/madrobby/extreme-javascript-performance

Editor's Notes

  1. bill fisher, hot studio, slides in pdf at url, html5 app vs. web app \n
  2. peter-paul koch: html5 app\ntouch\ngetting the native feel in the event handlers\ni’ll briefly touch on other issues in developing html5 apps\n
  3. apple wants 30% from publishers...?\n
  4. \n
  5. \n
  6. Gives FT huge flexibility and leverage in negotiating with Apple. Do they even need Apple?\n\n
  7. Can’t talk directly about recent work, but it was an HTML5 app.\nLots of interest in mobile / tablet\nBecause touch is inherently more limited than a mouse and keyboard, the relationship between different actions can result in conflict...\n
  8. \n
  9. webkit cross browser -- mobile safari and android browser\nlink to ben alman at the end\ndata - pinch not only scale, but current center point. pinch only works in recent android.\n
  10. not necessary to maintain the lexical scope for “this” because you get $target\n\n3d transforms - next slide.\n\n
  11. more research here...\n\nold android and rotate + 3d ?\n
  12. Frame rates don’t need to be faster than 30fps, typically. definitely not more than 60fps, the refresh rate of the screen. Events fire more rapidly, so the response needs to be throttled.\nHTML5 Rocks, link at end.\n\n
  13. Manipulate DOM fragments, then plug them in.\nLots of things can trigger reflow. Any display:none, any check of offsetWidth, etc.\nCheck out Paul’s 30min video on browser optimization.\n
  14. \n
  15. lots more research...\n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n