Cross Platform Mobility
Why and How to Build Cross Platform
Mobile Applications


Chris Auld
8 May 2012
WHY? MOBILE STRATEGY DISCUSSION      HOW? MOBILE EXECUTION DISCUSSION

 ļ‚§ Why mobile matters?                ļ‚§ Value in unique user experiences
 ļ‚§ Types of mobile apps               ļ‚§ Cross platform options
     ļ‚§ By user class                      ļ‚§ HTML+PhoneGap
     ļ‚§ By technology approach             ļ‚§ Mono
 ļ‚§ Why cross platform matters?            ļ‚§ Native x N
     ļ‚§ Does cross platform matter?    ļ‚§ Approaches to sharing code
     ļ‚§ Which platforms?               ļ‚§ Mono vs PhoneGap
     ļ‚§ When?
Why
Why Mobile Matters
ļ‚§ Does anyone in the room *not* have a smart device?
ļ‚§ Anyone in your family 15yr-65yr *not* have one?


ļ‚§ What did you use 1st today, PC or Smart Device?
ļ‚§ How about last yesterday?


ļ‚§ Have you used an app today?
Morgan Stanley Research from 2009



              Actual inflection
                   point
Types of Mobile Apps
 BY USER CLASS              BY APPLICATION APPROACH


  ļ‚§Enterprise                 ļ‚§Web Apps
    - Field force etc.            - It works
  ļ‚§SME/BYOD                       - It’s optimized
    - Expense claims etc.         - ICBINB
  ļ‚§Consumer                   ļ‚§ā€˜Real’ Apps
      - Mobile banking            - Wrapped HTML
                                  - Native
Why Cross Platform Matters
ļ‚§ Does it matter?
ļ‚§ Does need for enterprise apps kill BYOD strategy?
 Application Approach Extra Cost   Extra Dev Capex   Org Size for Break Even
 Web App/Wrapped HTML        20%   $50,000           250

 X-Platform Toolkit (Mono)   30%   $75,000           375

 Full Native                 70%   $175,000          875


 Assume: Enterprise app build of say $250k
 Assume: BYOD strategy to save $200/device via co-pay
 Assume: Three platforms ā€˜supported’ for BYOD
Why Cross Platform Matters
ļ‚§ For Consumer/Public focussed apps it really does
 matter.
  ļ‚§ iOS has massive penetration in high value user
    segments
  ļ‚§ Android is bring Smart devices to the masses
  ļ‚§ Microsoft is playing catch-up, but, is prepared to buy
    share
ļ‚§ Think back to the first slide… how do you use mobile?
Which Platforms?
ļ‚§ Market share?
ļ‚§ Visitor share?
    ļ‚§ Your site?
    ļ‚§ Some other ā€˜common’ site?

        You want to target, in priority order, the
      platforms used by people most likely to use
       their mobile devices to access your service
Which Platforms?
ļ‚§ IRD GST Site
  Want to support filing GST return from mobile device
ļ‚§ Business users
ļ‚§ Blackberry is still very popular with business users
ļ‚§ Should we prioritize Blackberry? iOS?
Which Platforms?
ļ‚§ How do app usage patterns differ?


ļ‚§ Both Android and iPhone users D/L approx 10 apps
  /month

ļ‚§ 19% of Android users buy at least one app /month
ļ‚§ 50% of iPhone users buy at least one app /month

*Admob Mobile Metrics
How
Different platforms are…different
Deserve different treatment at the UI level
Cross Platform Mobile App Dev
HTML + PhoneGap               Mono
• Significant reuse          • C# + .NET in            • Platform specific
    ļ‚§   Re-use web assets      VS.NET                    UX
• Doesn’t look native                                  • Can write highly
                               ļ‚§ Lambdas, LINQ
    ļ‚§ Everything like iOS?
                               ļ‚§ Delegates, Events       optimized code
•    AppStore issues                                     •   Games
                             • Rich
•    X-Browser issues
                               communications            •   Graphics intensive
•    No offline on WP7
                             • Access to almost all          apps
•    Animations poor                                   • Write the app 3
                               platform APIs via
•    APIs unavailable                                    times
                               Mono Wrappers
    •   Hardware access      • Go native if needed       • 3 different
    •   Platform specific    • UI still written ā€˜by-       languages
• It’s Javascript              hand’                     • 3 x code to maintain
    ļ‚§ Must use OSS             • Write UI for each       • Objective C is awful
    ļ‚§ Less productive            platform +ve&-ve


    100% Shared Code                                            0% Shared Code
Shared Code with Mono
ļ‚§ Shared files co-located; *.csproj for each platform
ļ‚§ Each solution has
    ļ‚§ Platform specific project
    ļ‚§ Shared project
ļ‚§ Similar MVVM pattern for all platforms
    ļ‚§ Shared Models
    ļ‚§ Shared Repository
    ļ‚§ May be able to share ViewModels
ļ‚§   Can use shared Interface + Platform Specific Implementation
    ļ‚§   WindowsPhonePreferencesProvider: IDevicePreferencesProvider
ļ‚§   Can use pre-processor directives
    ļ‚§   #if MONOTOUCH
ļ‚§   Can support Windows Mobile easily. No support for Blackberry
Shared Code with PhoneGap
ļ‚§ All files co-located
ļ‚§ A solution has
    ļ‚§ General purpose HTML + HTML templates
    ļ‚§ Shared CSS + JS + Images
    ļ‚§ Platform specific CSS + JS + Images
ļ‚§ Use MVVM or MVC pattern for all platforms
    ļ‚§ Backbone.js/Knockout.js
    ļ‚§ Share ā€˜everything’
ļ‚§ Complexity increases as platform count increases
    ļ‚§ Each platform may require some specific shims
    ļ‚§ Windows Mobile not supported & Older Blackberry OS is very hard to support
    ļ‚§ Older phones may get a ā€˜bad’ experience
Choosing between PhoneGap or Mono
 PHONEGAP                               MONO

   ļ‚§ Existing advanced HTML+JS skills    ļ‚§ Existing .NET C# dev skills
   ļ‚§ Must have MVVM/MVC                  ļ‚§ Useful to have MVVM/MVC
     knowledge                             knowledge
   ļ‚§ Existing web resources              ļ‚§ Complex communications
   ļ‚§ A need/desire to support browser      requirements
     based viewing                       ļ‚§ Need lots of platform hooks
   ļ‚§ Communications layer REST ready     ļ‚§ Performance matters
                                         ļ‚§ More productivity up-front
              The smaller your organization and project the
                   more developer productivity matters…
 Mono represents a high productivity choice even for pure one platform plays
Guidance By Intergen
Intergen staff have been involved in developing several reference
applications that are freely downloadable in source code form

ļ‚§ Project Silk http://silk.codeplex.com/ (Don Smith AKL)
  Rich HTML+JS Web Apps.
ļ‚§ Project Liike http://liike.github.com (Don Smith AKL)
  Rich HTML+JS Mobile Web Apps.
ļ‚§ StockTrader v6 https://azurestocktrader.cloudapp.net/
  (Chris Auld/James Carpinter WLG + others)
  Massive scale Azure based app with cross platform rich client for
  iOS, Android, WP7, HTML5+JS, Windows Metro (Mono based)
Mobile Matters – Mobile First
Do you *really* need x-platform
Phone + Mono both useful options
Questions
Thank You
Cross Platform Mobile Development

Cross Platform Mobile Development

  • 1.
    Cross Platform Mobility Whyand How to Build Cross Platform Mobile Applications Chris Auld 8 May 2012
  • 2.
    WHY? MOBILE STRATEGYDISCUSSION HOW? MOBILE EXECUTION DISCUSSION ļ‚§ Why mobile matters? ļ‚§ Value in unique user experiences ļ‚§ Types of mobile apps ļ‚§ Cross platform options ļ‚§ By user class ļ‚§ HTML+PhoneGap ļ‚§ By technology approach ļ‚§ Mono ļ‚§ Why cross platform matters? ļ‚§ Native x N ļ‚§ Does cross platform matter? ļ‚§ Approaches to sharing code ļ‚§ Which platforms? ļ‚§ Mono vs PhoneGap ļ‚§ When?
  • 3.
  • 4.
    Why Mobile Matters ļ‚§Does anyone in the room *not* have a smart device? ļ‚§ Anyone in your family 15yr-65yr *not* have one? ļ‚§ What did you use 1st today, PC or Smart Device? ļ‚§ How about last yesterday? ļ‚§ Have you used an app today?
  • 5.
    Morgan Stanley Researchfrom 2009 Actual inflection point
  • 6.
    Types of MobileApps BY USER CLASS BY APPLICATION APPROACH ļ‚§Enterprise ļ‚§Web Apps - Field force etc. - It works ļ‚§SME/BYOD - It’s optimized - Expense claims etc. - ICBINB ļ‚§Consumer ļ‚§ā€˜Real’ Apps - Mobile banking - Wrapped HTML - Native
  • 7.
    Why Cross PlatformMatters ļ‚§ Does it matter? ļ‚§ Does need for enterprise apps kill BYOD strategy? Application Approach Extra Cost Extra Dev Capex Org Size for Break Even Web App/Wrapped HTML 20% $50,000 250 X-Platform Toolkit (Mono) 30% $75,000 375 Full Native 70% $175,000 875 Assume: Enterprise app build of say $250k Assume: BYOD strategy to save $200/device via co-pay Assume: Three platforms ā€˜supported’ for BYOD
  • 8.
    Why Cross PlatformMatters ļ‚§ For Consumer/Public focussed apps it really does matter. ļ‚§ iOS has massive penetration in high value user segments ļ‚§ Android is bring Smart devices to the masses ļ‚§ Microsoft is playing catch-up, but, is prepared to buy share ļ‚§ Think back to the first slide… how do you use mobile?
  • 9.
    Which Platforms? ļ‚§ Marketshare? ļ‚§ Visitor share? ļ‚§ Your site? ļ‚§ Some other ā€˜common’ site? You want to target, in priority order, the platforms used by people most likely to use their mobile devices to access your service
  • 10.
    Which Platforms? ļ‚§ IRDGST Site Want to support filing GST return from mobile device ļ‚§ Business users ļ‚§ Blackberry is still very popular with business users ļ‚§ Should we prioritize Blackberry? iOS?
  • 11.
    Which Platforms? ļ‚§ Howdo app usage patterns differ? ļ‚§ Both Android and iPhone users D/L approx 10 apps /month ļ‚§ 19% of Android users buy at least one app /month ļ‚§ 50% of iPhone users buy at least one app /month *Admob Mobile Metrics
  • 12.
  • 13.
    Different platforms are…different Deservedifferent treatment at the UI level
  • 15.
    Cross Platform MobileApp Dev HTML + PhoneGap Mono • Significant reuse • C# + .NET in • Platform specific ļ‚§ Re-use web assets VS.NET UX • Doesn’t look native • Can write highly ļ‚§ Lambdas, LINQ ļ‚§ Everything like iOS? ļ‚§ Delegates, Events optimized code • AppStore issues • Games • Rich • X-Browser issues communications • Graphics intensive • No offline on WP7 • Access to almost all apps • Animations poor • Write the app 3 platform APIs via • APIs unavailable times Mono Wrappers • Hardware access • Go native if needed • 3 different • Platform specific • UI still written ā€˜by- languages • It’s Javascript hand’ • 3 x code to maintain ļ‚§ Must use OSS • Write UI for each • Objective C is awful ļ‚§ Less productive platform +ve&-ve 100% Shared Code 0% Shared Code
  • 16.
    Shared Code withMono ļ‚§ Shared files co-located; *.csproj for each platform ļ‚§ Each solution has ļ‚§ Platform specific project ļ‚§ Shared project ļ‚§ Similar MVVM pattern for all platforms ļ‚§ Shared Models ļ‚§ Shared Repository ļ‚§ May be able to share ViewModels ļ‚§ Can use shared Interface + Platform Specific Implementation ļ‚§ WindowsPhonePreferencesProvider: IDevicePreferencesProvider ļ‚§ Can use pre-processor directives ļ‚§ #if MONOTOUCH ļ‚§ Can support Windows Mobile easily. No support for Blackberry
  • 17.
    Shared Code withPhoneGap ļ‚§ All files co-located ļ‚§ A solution has ļ‚§ General purpose HTML + HTML templates ļ‚§ Shared CSS + JS + Images ļ‚§ Platform specific CSS + JS + Images ļ‚§ Use MVVM or MVC pattern for all platforms ļ‚§ Backbone.js/Knockout.js ļ‚§ Share ā€˜everything’ ļ‚§ Complexity increases as platform count increases ļ‚§ Each platform may require some specific shims ļ‚§ Windows Mobile not supported & Older Blackberry OS is very hard to support ļ‚§ Older phones may get a ā€˜bad’ experience
  • 18.
    Choosing between PhoneGapor Mono PHONEGAP MONO ļ‚§ Existing advanced HTML+JS skills ļ‚§ Existing .NET C# dev skills ļ‚§ Must have MVVM/MVC ļ‚§ Useful to have MVVM/MVC knowledge knowledge ļ‚§ Existing web resources ļ‚§ Complex communications ļ‚§ A need/desire to support browser requirements based viewing ļ‚§ Need lots of platform hooks ļ‚§ Communications layer REST ready ļ‚§ Performance matters ļ‚§ More productivity up-front The smaller your organization and project the more developer productivity matters… Mono represents a high productivity choice even for pure one platform plays
  • 19.
    Guidance By Intergen Intergenstaff have been involved in developing several reference applications that are freely downloadable in source code form ļ‚§ Project Silk http://silk.codeplex.com/ (Don Smith AKL) Rich HTML+JS Web Apps. ļ‚§ Project Liike http://liike.github.com (Don Smith AKL) Rich HTML+JS Mobile Web Apps. ļ‚§ StockTrader v6 https://azurestocktrader.cloudapp.net/ (Chris Auld/James Carpinter WLG + others) Massive scale Azure based app with cross platform rich client for iOS, Android, WP7, HTML5+JS, Windows Metro (Mono based)
  • 20.
    Mobile Matters –Mobile First Do you *really* need x-platform Phone + Mono both useful options
  • 21.
  • 22.