Craig Dunn
Developer Evangelist
Xamarin
craig@xamarin.com
@conceptdev
C# Everywhere
we’re not just on Windows
any more, Toto...
C# Everywhere
Mobile!
How Does it Work?
• Mono
C# + .NET implementation for Linux
started in 2001/released 2004
perfect fit for today’s mobile platforms: iOS & Android
.NET 4.5 / C# 5
• “Bindings”
exposes underlying SDKs as C#
think “projections” in Windows RT language:
http://stackoverflow.com/questions/7432905/what-are-winrt-language-projections
http://tirania.org/blog/archive/2011/Sep-15.html
How Does it Work?
• “Bindings”
exposes CocoaTouch/Objective-C as C#
you can write your own to incorporate any Objective-C
• Compiler
compiles IL and native runtime into native ARM app
can link out unused code - smaller executables
signs code for device testing and upload to App Store
iOS
How Does it Work?
• “Bindings”
exposes Android/Java as C#
you can write your own to incorporate any Java
• Compiler
produces IL and ships a native runtime to execute it
can link out unused code - smaller executables
signed for distribution to any phone, or stores like Google
Play, Amazon, ...
Android
How Does it Work?
• “Bindings”
exposes Cocoa/Objective-C as C#
you can write your own to incorporate any
Objective-C libraries/projects
• Compiler
produces IL and ships a native runtime to execute it
can link out unused code - smaller executables
apps can be distributed via Mac App Store
OS X
Why Xamarin.iOS?
• Write C# apps for iPhone, iPad and iPod
• Share C# with other platforms:
re-use C# from existing projects
• Create native iOS user interface
• Native app == native performance
• Entire iOS SDK directly accessible
(StoreKit, iCloud, etc)
• You can add your own Objective-C libraries too
Why Xamarin.Android?
• Write C# apps for Android phones & tablets
• Share C# with other platforms:
re-use C# from existing projects
• Create native Android user interface
• Native runtime == native performance
• Entire Android SDK available (including
Play Services and Compat Library)
• Use Java libraries (if required)
Why Xamarin.Mac?
• Write C# apps for Mac OS X
• Share C# with other platforms:
re-use C# from existing projects
• Create native Mac (Cocoa) user interface
• Native app == native performance
• Entire Mac SDK directly accessible
• You can add your own Objective-C libraries too
companion
apps...
How Does it Work?
How Does it Work?
Mac OS X WindowsWindows
IDE
iOS
Android
Mac
Windows/Phone
C# Development Environments
Xamarin
Business
Edition+
Mac
+
Mac OS XWindows
Visual Studio Xamarin Build Host
Xamarin.iOS for
Visual Studio plug-in
Build Host configuration
iOS Projects
iOS Property Pages
iOS build, deploy, debug
iOS Output panes
Device iOS Simulator
Apple iOS SDK
Xcode
Interface Builder
Compiler
Keychain Certifications
Provisioning Profiles
Network
access
iOS apps
in Visual
Studio?!
C# Development Environments
• Coding
Auto-complete
Refactoring
• User Interface Design
GUI tools
• Debugging
• Build & Deploy
Simulators & Devices
Testing & Production/App Stores
IOS
C# on iPhone, iPad and iPod touch
iOS Development Environment
Xamarin Studio
Visual Studio
iOS UI Designer
Xcode - now
Xamarin Designer - alpha
iOS Development Environment
• Code signing
• App configuration
• Deployment
Keychain - certificates
iOS Development Environment
• Code signing
• App configuration
• Deployment
Provisioning Portal
http://developer.apple.com
iOS Development Environment
• Code signing
• App configuration
• Deployment
DEMO
ANDROID
C# on Android (Google Play, Kindle, ...)
Android Development Environment
Xamarin Studio
Visual Studio
Android UI Designer
Xamarin Studio
Visual Studio
Android Development Environment
Shared runtime for
debugging only.
Linking reduces size
Choose CPU arch
Android Development Environment
• AndroidManifest.xml
Permissions
App configuration
use [Activity] and
other attributes
Android Development Environment
• Deployment
Signing wizard
DEMO
MAC
C# on OS X
OS X Development Environment
Xamarin Studio
OS X UI Designer
Xcode
OS X Development Environment
• Code signing
• App configuration
DEMO
CODE SHARING
C# Everywhere!
C# Everywhere
C# Everywhere
To Do List
SHARE
Components
Code
‘Structure’
Design
Field Service
MVVM Example
Shared
Shared
iOS Android
C# Everywhere
Recap
• Build iOS apps in C# with .NET
• Use Xamarin Studio or Visual Studio
• Apps have native look and feel
• Apps are native, with native performance
• Share code
• Component Store
http://components.xamarin.com
What else?
• async/await
• F#
• Portable Class Libraries (PCL)
• iOS7
New features and APIs...
• Google Play Services
In app purchasing, Location services, Maps v2
Go!
• 10 minute guide to building an app
http://xamarin.com/getting-started
• Docs, Recipes
http://docs.xamarin.com/
• Forums
http://forums.xamarin.com
• Samples
http://github.com/xamarin
http://xamarin.com/download
Questions?
Developer Evangelist
Xamarin
craig@xamarin.com
@conceptdev
Craig Dunn

C# everywhere