Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Javascript Strategies for Hybrid Apps and Mobile Web

Tuenti
November 08, 2013

Javascript Strategies for Hybrid Apps and Mobile Web

In this talk we share challenging issues that we encountered when developing Webviews for Android and iOS. Why we think Webviews and Mobile Web are two closely related, but different problems. We will also discuss PhoneGap and how it is a game changer, but also how the best way to use it in a Hybrid App might not be the most obvious one.

Tuenti

November 08, 2013
Tweet

More Decks by Tuenti

Other Decks in Technology

Transcript

  1. 5 million unique users per week 50% use Mobile 2

    million use Mobile Only Thursday, November 7, 2013
  2. A Hybrid App is a Mobile App in which some

    of the main functionality is web based Thursday, November 7, 2013
  3. Disclaimer: We are talking remote webviews Important: Not all Javascript

    has to be remote. You can mix local and remote Javascript Thursday, November 7, 2013
  4. 2. You can very easily open Native functionality from a

    WebView. Thursday, November 7, 2013
  5. What is the web good at? Portability Layout, formatting text.

    Delivery Share Functionality You Control the Updates Fast Prototyping Thursday, November 7, 2013
  6. Not so Good. Performance? IOS Browser Speed Bake off Performance

    differences are mostly determined by network speed Thursday, November 7, 2013
  7. Not so Good. Performance? Native Browser ~ WebView Browser In

    Android Uses V8 Thursday, November 7, 2013
  8. Not so Good. Linked In Mobile Breakup Sencha FastBook Tools

    Android Webview Debug Tools Thursday, November 7, 2013
  9. On 2011 - 500K pageviews daily We still have about

    100k daily Says that it supports Javascript.. but it doesn’t really Thursday, November 7, 2013
  10. 1. Be Plain Have a version without Javascript that works

    everywhere Thursday, November 7, 2013
  11. Plain navigation No-Ajax submit A webview in a low-grade Android

    would see a ‘plain’ version Thursday, November 7, 2013
  12. Bonus: Dumb Site can be used for not so smart

    desktop browsers ... IE6/IE7 Thursday, November 7, 2013
  13. Fastest Javascript is the one you do not need to

    execute Thursday, November 7, 2013
  14. Disclaimer: We are talking remote webviews Not the standard way

    to set up your PhoneGap App Thursday, November 7, 2013
  15. Cordova is big, 70K compressed Have the communication bridge deployed

    locally. Rest of JS is remote. Thursday, November 7, 2013
  16. public class MyWebViewClient extends CordovaWebViewClient { /** Once the page

    has finished loading it loads cordova in a non blocking fashion. Note that this means that cordova initialization is slower for 2.* clients than it would be for 4.* clients as it happens after the DOMContentRender event **/ public void onPageFinished(WebView view, String url) { view.loadUrl("javascript:" + this.readFile("cordova.js")); super.onPageFinished(view, url) } } } Thursday, November 7, 2013