$30 off During Our Annual Pro Sale. View Details »

Anatomy of an App

alunny
April 25, 2012

Anatomy of an App

What makes an app native? What matters when making apps native?

Links: https://gist.github.com/2491334

alunny

April 25, 2012
Tweet

More Decks by alunny

Other Decks in Technology

Transcript

  1. cross-platform native mobile apps using HTML5 ‣ Objective-C ‣ Java

    ‣ Android flavor ‣ BlackBerry flavor ‣ C#
  2. cross-platform native mobile apps using HTML5 VS This is not

    a real problem Your app is not a runtime
  3. nasty, brutish and short ‣ killed by the OS (or

    the browser) ‣ interrupted ‣ network dropped
  4. $.on(‘offline’, function () { app.hasNetwork = false }) listen to

    the network $.on(‘online’, function () { app.hasNetwork = true })
  5. ‣ Web: hyperlinks! ‣ Android: intents ‣ iOS: custom URL

    scheme ‣ future: web intents communication
  6. function share(thing, where) { if (where == ‘facebook’) { fbShare(thing)

    } else if (where == ‘twitter’) { twitterShare(thing) } else { alert(“don’t use “ + where) } }) roll your own
  7. function share(thing, where) { if (where == ‘facebook’) { open(“fb://”

    + thing) } else if (where == ‘twitter’) { open(“twitter://” + thing) } else { alert(“don’t use “ + where) } }) URL schemes
  8. And then... *pow*... performance issues that weren't related to anything

    that I could find: it seemed some combination of CSS/ HTML/JavaScript was getting in the way.
  9. I've finally pared it down to nothing but Zepto unless

    I really really need something else. Even just getting away from core JQuery makes a big difference.
  10. var $ = document.querySelectorAll.bind(document) // and something like Element.prototype.on =

    Element.prototype.addEventListener $(‘#mylink’)[0].on(‘touchstart’, handleTouch, false) Use what’s there