Why and How to Build Cross Platform Mobile Applications · WHY? MOBILE STRATEGY DISCUSSION Why...
Transcript of Why and How to Build Cross Platform Mobile Applications · WHY? MOBILE STRATEGY DISCUSSION Why...
Chris Auld 8 May 2012
Cross Platform Mobility Why and How to Build Cross Platform Mobile Applications
WHY? MOBILE STRATEGY DISCUSSION
Why mobile matters?
Types of mobile apps
By user class
By technology approach
Why cross platform matters?
Does cross platform matter?
Which platforms?
When?
HOW? MOBILE EXECUTION DISCUSSION
Value in unique user experiences
Cross platform options
HTML+PhoneGap
Mono
Native x N
Approaches to sharing code
Mono vs PhoneGap
Why
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?
Why Mobile Matters
Morgan Stanley Research from 2009
Actual inflection point
BY USER CLASS
Types of Mobile Apps
Enterprise
- Field force etc.
SME/BYOD
- Expense claims etc.
Consumer
- Mobile banking
BY APPLICATION APPROACH
Web Apps
- It works
- It’s optimized
- ICBINB
‘Real’ Apps
- Wrapped HTML
- Native
Does it matter?
Does need for enterprise apps kill BYOD strategy?
Why Cross Platform Matters
Application Approach Extra Cost
Web App/Wrapped HTML 20%
X-Platform Toolkit (Mono) 30%
Full Native 70%
Assume: Enterprise app build of say $250k Assume: BYOD strategy to save $200/device via co-pay Assume: Three platforms ‘supported’ for BYOD
Extra Dev Capex Org Size for Break Even
$50,000 250
$75,000 375
$175,000 875
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?
Why Cross Platform Matters
Market share?
Visitor share? Your site?
Some other ‘common’ site?
Which Platforms?
You want to target, in priority order, the platforms used by people most likely to use their mobile devices to access your service
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
Which Platforms?
*Admob Mobile Metrics
How
Different platforms are…different Deserve different treatment at the UI level
Cross Platform Mobile App Dev HTML + PhoneGap • Significant reuse
Re-use web assets • Doesn’t look native
Everything like iOS? • AppStore issues • X-Browser issues • No offline on WP7 • Animations poor • APIs unavailable
• Hardware access
• Platform specific • It’s Javascript
Must use OSS
Less productive
Mono • C# + .NET in
VS.NET Lambdas, LINQ
Delegates, Events • Rich
communications • Access to almost all
platform APIs via Mono Wrappers
• Go native if needed • UI still written ‘by-
hand’ • Write UI for each
platform +ve&-ve
100% Shared Code 0% Shared Code
• Platform specific UX
• Can write highly optimized code • Games
• Graphics intensive apps
• Write the app 3 times • 3 different
languages
• 3 x code to maintain
• Objective C is awful
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 Mono
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
Shared Code with PhoneGap
PHONEGAP
Choosing between PhoneGap or Mono
Existing advanced HTML+JS skills
Must have MVVM/MVC knowledge
Existing web resources
A need/desire to support browser based viewing
Communications layer REST ready
MONO
Existing .NET C# dev skills
Useful to have MVVM/MVC knowledge
Complex communications requirements
Need lots of platform hooks
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
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)
Guidance By Intergen
Mobile Matters – Mobile First Do you *really* need x-platform Phone + Mono both useful options
Questions
Thank You