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.

088e93df631d5c679b107b855b4daa48?s=128

Jason Kneen

May 11, 2014
Tweet

Transcript

  1. Adventures in cross platform Jason Kneen

  2. +BTPO,OFFO http://twitter/jasonkneen http://github.com/jasonkneen http://jasonified.com http://bouncingfish.com App Developer, TCE Certified Titanium

    “Titan”
  3. • Breakdown pricing; Core, iOS, Android • Factor in platform,

    form factors • Include costs for AppStore submissions, re-submissions Pricing
  4. Design Retina Dimensions No font details Designed for iOS

  5. • Acknowledge OS differences (Nav, back buttons) • Educate the

    client / designer • Give examples / links to tools • Send them images folder structure Design
  6. • Real devices • hdpi, ldpi, etc • Multiple OSs

    • Don’t forget 2.3.x Testing
  7. • TestFlight • Installrapp Delivery

  8. • Free, easy • Fast • Google APIs, Play support,

    simple “hack” • Great GPS, Mapping tools • Android first! Genymotion
  9. Android development before Genymotion

  10. Android development after Genymotion

  11. • 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
  12. • 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
  13. • Separate business logic • APIs, Social, GPS etc •

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

    • app.tss for global classes • “reset” for Android • Platform specific overrides app.tss, classes
  15. • 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
  16. • Very granular • Long, NotLong, Landscape, Portrait • Keep

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

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

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

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

    • Create cross-platform template wrappers Base Controllers
  21. • <require src=“controllerName”/> • Latest Alloy supports require/widgets with children

    • Create a wrapper template controller Require templates
  22. • 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
  23. None
  24. Thank you!

  25. +BTPO,OFFO http://twitter/jasonkneen http://github.com/jasonkneen http://jasonified.com http://bouncingfish.com