C# Everywhere 
Cross-Platform Apps with Xamarin 
Sasha Goldshtein 
CTO, Sela Group 
blog.sashag.net @goldshtn 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
everyone in this 
room is a 
mobile 
developer 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
The Search for the Holy Grail 
End-user 
experience 
Native 
Developer 
productivit 
y 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin 
XXaammaarrinin 
Web/hy 
brid
The Xamarin Approach 
• Fully native apps written entirely in C# 
• Visual Studio designer, editor, debugger 
• 100% of the native platform API available 
• Sharing logic across platforms with PCLs 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
C# on 2.6 Billion Devices 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
How Xamarin Works 
• C# bindings to 100% of the native API 
• .NET runtime installed on the device as 
part of the application 
• Native compilation 
– iOS: ahead-of-time compilation 
– Android: just-in-time compilation (like Java) 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Tools and Platforms 
• Xamarin Studio stand-alone IDE 
– Cross-platform: OS X and Windows 
– Supports iOS, Android, OS X 
• Visual Studio extension 
– Windows only 
– Requires OS X build host for OS X and iOS 
– Supports Windows Phone and Windows 8 
targets 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Xamarin Successes 
Rdio 
Bosch-Siemens 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin 
Calca
Building an Android app in Visual Studio 
DEMO 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Code Sharing Philosophy 
• The view layer usually requires duplication 
• The rest of the app (up to 90% code) can 
be shared 
Windows 
Phone UI 
AAnnddrrooidid UUII iOiOSS UUII Windows 
Phone UI 
Shared PCL 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Platform-Specific Code 
• Some platform-specific services are 
inevitable; hide them behind interfaces 
Android layer 
LocationManager 
Android layer 
LocationManager 
CLLocationManager 
Shared PCL 
iOS layer 
depends on ILocationProvider 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin 
iOS layer 
CLLocationManager 
DI DI
Adding an iOS app with shared components 
DEMO 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Even More Code Sharing 
• Xamarin.Forms is a cross-platform 
XAML-based UI library for simple controls 
• MvvmCross is an open source library that 
introduces XAML-like data binding and 
commands to iOS and Android 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Using Xamarin.Forms for 100% code sharing 
DEMO 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Decision Making 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin
Sasha Goldshtein 
blog.sashag.net 
@goldshtn 
s.sashag.net/sa-xamarin 
Thank You! 
Join the conversation on Twitter: @SoftArchConf #SA2014 
This presentation: http://s.sashag.net/sa-xamarin

C# Everywhere: Cross-Platform Mobile Apps with Xamarin

  • 1.
    C# Everywhere Cross-PlatformApps with Xamarin Sasha Goldshtein CTO, Sela Group blog.sashag.net @goldshtn Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 2.
    everyone in this room is a mobile developer Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 3.
    The Search forthe Holy Grail End-user experience Native Developer productivit y Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin XXaammaarrinin Web/hy brid
  • 4.
    The Xamarin Approach • Fully native apps written entirely in C# • Visual Studio designer, editor, debugger • 100% of the native platform API available • Sharing logic across platforms with PCLs Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 5.
    C# on 2.6Billion Devices Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 6.
    How Xamarin Works • C# bindings to 100% of the native API • .NET runtime installed on the device as part of the application • Native compilation – iOS: ahead-of-time compilation – Android: just-in-time compilation (like Java) Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 7.
    Tools and Platforms • Xamarin Studio stand-alone IDE – Cross-platform: OS X and Windows – Supports iOS, Android, OS X • Visual Studio extension – Windows only – Requires OS X build host for OS X and iOS – Supports Windows Phone and Windows 8 targets Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 8.
    Xamarin Successes Rdio Bosch-Siemens Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin Calca
  • 9.
    Building an Androidapp in Visual Studio DEMO Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 10.
    Code Sharing Philosophy • The view layer usually requires duplication • The rest of the app (up to 90% code) can be shared Windows Phone UI AAnnddrrooidid UUII iOiOSS UUII Windows Phone UI Shared PCL Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 11.
    Platform-Specific Code •Some platform-specific services are inevitable; hide them behind interfaces Android layer LocationManager Android layer LocationManager CLLocationManager Shared PCL iOS layer depends on ILocationProvider Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin iOS layer CLLocationManager DI DI
  • 12.
    Adding an iOSapp with shared components DEMO Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 13.
    Even More CodeSharing • Xamarin.Forms is a cross-platform XAML-based UI library for simple controls • MvvmCross is an open source library that introduces XAML-like data binding and commands to iOS and Android Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 14.
    Using Xamarin.Forms for100% code sharing DEMO Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 15.
    Decision Making Jointhe conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin
  • 16.
    Sasha Goldshtein blog.sashag.net @goldshtn s.sashag.net/sa-xamarin Thank You! Join the conversation on Twitter: @SoftArchConf #SA2014 This presentation: http://s.sashag.net/sa-xamarin