SlideShare a Scribd company logo
Cross Platform Mobile
Development in C#
Ross Dargan
@rossdargan
What I’m going to cover
Target 95% of the UK mobile market in C#
With maximum code re-use
What I’m going to cover
What I won’t cover
The other cross platform options
(http://propertycross.com/)
A full walkthrough of the tooling
Blackberry
Android
56%
Windows
12%
iOS
27%
Blackberry
4%
Other
1%
Other
5%
UK Smartphone Landscape
Source: http://bit.ly/19d2thf
Native Development
iOS
Objective C
Xcode
Windows Phone
C#/Visual Basic/F#
Visual Studio
Android
Java
Eclipse
IntelliJ
Xamarin
• C# and .NET for Android, iOS and Mac
• Full native APIs
The bad…
• Price $2000 per dev per year
• Still need a mac
• Write once, run (and test!) everywhere
• Tooling is still a bit immature (but the
support is great!)
• Need to write each UI separately
UI Considerations
DEMO
Hello World
So… Sharing
SHARING CODE
File Linking
File Linking
DEMO
File Linking
File Linking
Pros
• Quick
Cons
• Messy code
• Progressively more
difficult to maintain as you
add implementations
• Very hard to test
• File linking is a PITA to
remember as you add
files
SHARING CODE
Portable Class Libraries
Adding a PCL
Great… but
Still need platform specific code somehow…
SHARING CODE
Abstract Classes
Multiple Concrete Classes
DEMO
Abstract Classes
Abstract Classes
Pros
• Quick
• Easier to maintain
• Follows Open/Closed
principal
Cons
• Difficult to test
• Pretty inflexible
SHARING CODE
Dependency Injection
Dependency Injection
• Helps separate code (Single responsibility)
• Allows you to unit test’s discrete parts of
the implementation – no God classes
• You can inject in platform specific
implementations
• Inversion of Control allows you to swap
implementations easily
DEMO
PCL & DI demo
Dependency Injection
Pros
• Very loosely coupled
code (reuse)
• Unit tests are easy
• Single Responsibility
• Open/Closed
Cons
•
•
•
Cross Platform Development in C# (DDDNorth 2013)
Cross Platform Development in C# (DDDNorth 2013)
What are the downsides to using
Dependency Injection?
It can be dangerous for your career because it
may increase your overall knowledge of good API
design. Once you learn how proper loosely
coupled code can look like, it may turn out that you
will have to decline lots of job offers because you
would otherwise have to work with tightly
coupled legacy apps. Happens to me a lot :)
Source: http://bit.ly/com6aD
Dependency Injection
Pros
• Very loosely coupled
code (reuse)
• Unit tests are easy
• Single Responsibility
• Open/Closed
Cons
• More code
• Bloated constructors
Cross Platform Development in C# (DDDNorth 2013)
Can we squeeze any more reuse
out?
MAXIMIZE UI CODE REUSE
MVVM
MVVM
Platform Specific Code
Shared Code
Demo
Improving Code Reuse in 3 easy
ways
• Heavy use of dependency injection
– Allows different implementations for different
platforms
• Use PCLs (and file linking for the time
being)
• Use View Models to reuse presentation
code
3 layers of win
MVVMCross
Xamarin
Visual Studio
Links
• http://xamarin.com/
• http://mvvmcross.wordpress.com/
• http://propertycross.com/
• https://github.com/rossdargan/Talks
• Dependency Injection in .Net by Mark
Seemann (ISBN: 1-935182-50-1)
• http://www.icndb.com/api/
Questions

More Related Content

PPT
OSCON Titanium Tutorial
PPTX
Xamarin UI Test And Xamarin Test Cloud
PPTX
BDD in Xamarin with Specflow & Xamarin UI Test
PDF
Xamarin for (not only) Android developers
PPTX
Write Better JavaScript
PDF
Introduction to Android with C# using Xamarin
PPT
Cross platform mobile application development
PPTX
C# everywhere: Xamarin and cross platform development
OSCON Titanium Tutorial
Xamarin UI Test And Xamarin Test Cloud
BDD in Xamarin with Specflow & Xamarin UI Test
Xamarin for (not only) Android developers
Write Better JavaScript
Introduction to Android with C# using Xamarin
Cross platform mobile application development
C# everywhere: Xamarin and cross platform development

What's hot (19)

PPTX
Building Native “apps” with Visual Studio 2015
PPTX
Cross platform approach for mobile application development : a survey
PDF
Xcoders - iOS & Android Development in C# with Xamarin
PDF
Selenium training12 1
PPTX
Selenium web driver_2.0_presentation
DOCX
Selenium training course_content_3_days
PPTX
Xamarin Best Cross Platform Mobile App Development Solution
PPT
Flex on Grails - Rich Internet Applications With Rapid Application Development
PDF
Swift vs flutter pixel values technolabs
PDF
Building hybrid apps with Xamarin, Ryan Paul
PPT
Visual studio 2015 and .net core 5 – get ready to rumble
PDF
PHP, Java EE & .NET Comparison
PDF
iOS & Android Dev in C# & Visual Studio using Xamarin
PPT
Cross Platform Mobile Development with Xamarin
PDF
MS Experiences 17 - Xamarin: Future of Mobile Development
PPTX
Comparison of Programming Platforms
PPTX
Visual Studio 2015 and the Next .NET Framework
PPTX
Xamarin Applications - Xamarin Fest
PPTX
Java Programming (M&M)
Building Native “apps” with Visual Studio 2015
Cross platform approach for mobile application development : a survey
Xcoders - iOS & Android Development in C# with Xamarin
Selenium training12 1
Selenium web driver_2.0_presentation
Selenium training course_content_3_days
Xamarin Best Cross Platform Mobile App Development Solution
Flex on Grails - Rich Internet Applications With Rapid Application Development
Swift vs flutter pixel values technolabs
Building hybrid apps with Xamarin, Ryan Paul
Visual studio 2015 and .net core 5 – get ready to rumble
PHP, Java EE & .NET Comparison
iOS & Android Dev in C# & Visual Studio using Xamarin
Cross Platform Mobile Development with Xamarin
MS Experiences 17 - Xamarin: Future of Mobile Development
Comparison of Programming Platforms
Visual Studio 2015 and the Next .NET Framework
Xamarin Applications - Xamarin Fest
Java Programming (M&M)
Ad

Similar to Cross Platform Development in C# (DDDNorth 2013) (20)

PDF
Device fragmentation vs clean code
PDF
Mobile Development
PPTX
Mobile Cross Platform Automation in-practice and on a Large Scale
PPTX
Mobile App Landscape for the Non-Technical
PDF
Xamarin v.Now
PPTX
Kotlin Multiplatfom In Action
PPTX
Top 4 Cross Platform tools for Mobile App Development
PDF
Kotlin Multiplatfom In Action
PPTX
Xamarin COE by Mukteswar Patnaik
PPTX
Build Your First iPhone or Android App with Telerik AppBuilder
PPTX
Introduction to xamarin
PDF
Your choices for building a mobile app in 2016
PDF
Post Windows Mobile: New Application Development Platforms
PPTX
Develop business apps cross-platform development using visual studio with x...
PPT
Native App Development for iOS, Android, and Windows with Visual Studio
PPTX
Cross platform mobile application devlopment
PPTX
Introduction to xamarin
PDF
C# everywhere
KEY
The Architect Way
PPTX
Getting started with Xamarin forms
Device fragmentation vs clean code
Mobile Development
Mobile Cross Platform Automation in-practice and on a Large Scale
Mobile App Landscape for the Non-Technical
Xamarin v.Now
Kotlin Multiplatfom In Action
Top 4 Cross Platform tools for Mobile App Development
Kotlin Multiplatfom In Action
Xamarin COE by Mukteswar Patnaik
Build Your First iPhone or Android App with Telerik AppBuilder
Introduction to xamarin
Your choices for building a mobile app in 2016
Post Windows Mobile: New Application Development Platforms
Develop business apps cross-platform development using visual studio with x...
Native App Development for iOS, Android, and Windows with Visual Studio
Cross platform mobile application devlopment
Introduction to xamarin
C# everywhere
The Architect Way
Getting started with Xamarin forms
Ad

Recently uploaded (20)

PDF
Spectral efficient network and resource selection model in 5G networks
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
KodekX | Application Modernization Development
PPTX
Spectroscopy.pptx food analysis technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectral efficient network and resource selection model in 5G networks
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
KodekX | Application Modernization Development
Spectroscopy.pptx food analysis technology
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The AUB Centre for AI in Media Proposal.docx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
sap open course for s4hana steps from ECC to s4
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Cross Platform Development in C# (DDDNorth 2013)