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

Adventures in Cross Platform

Adventures in Cross Platform

My Talk from Day 2 of TiConf US 2014 on cross-platform lessons learnt.

Jason Kneen

May 11, 2014
Tweet

More Decks by Jason Kneen

Other Decks in Technology

Transcript

  1. • Breakdown pricing; Core, iOS, Android • Factor in platform,

    form factors • Include costs for AppStore submissions, re-submissions Pricing
  2. • Acknowledge OS differences (Nav, back buttons) • Educate the

    client / designer • Give examples / links to tools • Send them images folder structure Design
  3. • Free, easy • Fast • Google APIs, Play support,

    simple “hack” • Great GPS, Mapping tools • Android first! Genymotion
  4. • See changes (almost) instantly • Works on simulator, emulator,

    device • Instantly resolve platform differences as you go • Don’t get “locked in” to one platform • But, there be dragons! Use TiShadow / Liveview
  5. • Separation of business logic & UI • Isolate code

    with OS_IOS, OS_ANDROID • Platform, formfactor specific elements • Only relevant code / files are included in a build • Makes cross-plaform easier Alloy
  6. • Separate business logic • APIs, Social, GPS etc •

    Better memory management • Easier to re-use commonJS
  7. • Define granular classes • Test layouts on both platforms

    • app.tss for global classes • “reset” for Android • Platform specific overrides app.tss, classes
  8. • Use dp/dip (ti.ui.defaultunit) • Avoid fixed widths / heights,

    unless.. • Top, Left, Bottom, Right is the same on all devices • %age and fluid layouts • Dynamic buttons Flexible layouts
  9. • Very granular • Long, NotLong, Landscape, Portrait • Keep

    it simple • Retina images and Android ! ! Density Images
  10. • iOS style stretchable images • Splash screens • Android

    version of leftCap, topCap • Editor built-in to Android SDK • http://9patch.fokkezb.nl/ ! 9-Patch images
  11. • Reduce “over the bridge” calls • TableViews - classname

    • ImageViews vs Views • ListViews over TableViews • Reduce views, especially in tables Android Performance
  12. • Views = screens • Swipe between (great for prototyping

    / demos) • Disable manual swiping • Simple view stack management • Super-fast and smooth animation on Android ScrollableView Navigation
  13. • Simple “inheritance” for Alloy Controllers • Re-use controllers, views

    • Create cross-platform template wrappers Base Controllers
  14. • Little-known feature of Alloy • Override Alloy Tags to

    provide per-platform support • Create your own tags! • Not a replacement for Widgets, just different The “module” attribute