TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and MvvmCross
1. Sydney Mobile .Net
Developers
Cross Platform Native App Development
iOS, Android, Windows Phone, Windows 8
Alec Tucker
Head of Mobile Product Development, APAC
White Clarke Group
2. Inaugural Meetup
• Introductions
• Focus on Mobile, .Net, Xamarin
• Planned format
• Group Details
• http://xamarin.meetup.com/
• http://www.meetup.com/SydneyMobileDotNetDevelopers/
• Current sponsors…
3. Leaders in Finance Technology
(also pretty good at supplying venue and pizza!!)
4. • Sign up at xamarin.com/university
• Learn to build native iOS, Android, and Windows
apps with C# in just 30 days.
• Live online, interactive classes with live coding.
• Labs with full source code solutions.
• Nearly 600 pages of curriculum documentation.
• Access to Xamarin Certified Developer exam.
• First March session is filling up fast.
6. The Plan
• Approaches to Cross Platform Mobile Dev
• WORA / WOOE
• Cross Platform AND Native
• Code Sharing Approaches
• File Linking
• Portable Class Libraries
• MVVM Pattern Suitability
• Using MVVM in iOS and Android Apps
7. Android Fragmentation
July 2012 – 3,997 distinct devices
July 2013 – 11,868 distinct devices
Source: http://opensignal.com/reports/fragmentation-2013/
11. Approaches
• App dev – multiple platforms
• Mobile Web Hybrid Native
• Historically native has been overlooked as it’s assumed to mean
developing separately for each platform
• Cross platform AND native…
12. Cross Platform AND Native
Xamarin
Write one shared C# codebase, and separate platform-specific
user interfaces also in C#. The result is native apps that share
business logic, data access, networking code and more.
Compilation
Xamarin.iOS does ahead-of-time compilation to produce ARM
binaries for Apple’s App Store.
Xamarin.Android uses just-in-time compilation.
In both cases the app is native. Not cross compiled. Not
interpreted. Native.
13. Code Sharing Approaches
• File linking
• Quick demo
• Pros
• Shared code can be put within precompiler directives to control which
bits are compiled for which platforms
• Can be used to implement platform specific code / features
• Cons
• Can seem like a good idea, but you can quickly come unstuck and end
up with unmaintainable code…
14. (shamelessly pinched from James Montemagno’s presentation at the Seattle Mobile .Net
Developers meetup)
16. MVVM Pattern
Views
Platform
specific
UI – how to display information
Data Binding
View Models
What information to display
Flow of interaction
Reference
Models
Data entities
Portable
Although this looks good in theory, and does have it’s uses, it is open to being overused.Heavy use of precompiler directives can quickly lead to unmaintainable code.