SlideShare a Scribd company logo
Xamarin
Mobile Cross Platform Development
bryan costanich
em: bryanc@xamarin.com
tw: @bryancostanich
slides: slideshare.net/bryancostanich
Sample Code
github.com/xamarin/mobile-samples/TaskyPro
blog.xamarin.com
Xamarin Platform
(The Pitch)
One Language +
Framework
LINQ
Lambdas
Task Parallel Library (TPL)
Compile-Time Checks
Garbage Collection
C#
º
Native Perf. + UX
Compiles Down to Native Code
Not Interpreted
All Native UX Controls
Full Platform SDK Access
iOS: Selectors/Obj-C Runtime
Android: JNI
Fast Enough for Games
º
Reuse Story
C# Libraries
Obj-C Bindings + Binding Projects
.jar Bindings + Binding Projects
C via pInvoke
C++ via Cxxi
º
Other Platforms
Windows - via .NET
Mac - via Xamarin.Mac
Linux - via Mono
Ouya, XBOX, PSP, etc.
Etc.
Community +
Support
Huge C# Community
StackOverflow.com
forums.xamarin.com
IRC + chat.xamarin.com
Great Support
º
VS + Xamarin
Studio
Visual Studio
Xamarin Studio
Android Designer
iOS Designer (Beta)
Debugging
AutoComplete
Refactoring
Project Management
Integrated Source Control
General XPlat Considerations
Design Platform-Specific UX
UX in iOS != Android != Windows
Phone
UX Metaphors are Different:
Navigation Controller vs. Back
Button
Write-Once, Run-Anywhere is
Problematic
Users Expect Native UX
º
Choose Device
Targets
iPhone != iPad
Beware Android Fragmentation
Form Factor + Capability Differences
Inform UX
Pro-Tip: Minimize Targets
º
Building an X-Plat Architecture
Architecture
Layers
Separation of Responsibility
Encapsulation
Core Code Sharing
º
VS Project/Solution Setup
Code Sharing - Linking vs. PCL
Portal Library Projects - Take a Lot of Work
Great Discussion Here:
http://forums.xamarin.com/discussion/28/challenges-thoughts-loves/p1
Takeaway:
PCL is clean, but difficult to implement
Linking is less “clean” but simpler
Our Recommendation Now: File Linking for Most Projects
Walkthrough Here: Linking
º
WP7 + Android
New Blank Solution: "[AppName]"
New C# Lib Project: "[AppName].Core"
Test Project: “[AppName].Core.Tests”
New Mono for Android Project: “[AppName].Droid”
New WP7 Project "[AppName].WP7"
º
Shared Data +
Data Access
Layer
Data Access
Layer
SQLite on iOS + Android, C# SQLIte on WP7:
http://code.google.com/p/csharp-sqlite/
SQLite.NET ORM
Use Generics for CRUD Convenience Methods:
TaskDatabase.cs
º
Platform Abstractions
Handling Divergence and Taking Advantage of Platform
Features
Conditional
Compilation
Pre-Defined Symbols:
#if __MOBILE__
#if __ANDROID__
#if __IOS__
#if WINDOWS_PHONE
#if SILVERLIGHT
Can Add Additional in Build Settings
Architectural
Abstraction
Sometimes, You Wanna Provide
Different Implementations for Different
Platforms
Interfaces
º
Component Store
Tons of Components
Cross-Platform
IDE-Integration - drop-in!
Revenue Model for User
Submitted
Xamarin.* Libraries
XPlat API Abstractions
Open Source
Github.com/Xamarin/Xamarin.*
Mobile Social Auth
Other XPlat Libs
MonoCross - http://code.google.com/p/monocross/
MvvmCross - https://github.com/slodge/MvvmCross
Vernacular - https://github.com/rdio/vernacular
MonoGame - http://monogame.net
Cocos2D - http://cocos2DXNA.net
º
Q+A

More Related Content

PDF
iOS & Android Dev in C# & Visual Studio using Xamarin
PDF
Introduction to Android with C# using Xamarin
PDF
Xamarin for (not only) Android developers
PPTX
[MobConf] Go mobile with C#, Visual Studio & Xamarin
PDF
C# everywhere
PDF
AnDevCon - Android and iOS Apps in C# with Xamarin
PDF
MS Experiences 17 - Xamarin: Future of Mobile Development
PPTX
.NET Fest 2018. Михаил Галушко. Искусственный интеллект на платформе Xamarin
iOS & Android Dev in C# & Visual Studio using Xamarin
Introduction to Android with C# using Xamarin
Xamarin for (not only) Android developers
[MobConf] Go mobile with C#, Visual Studio & Xamarin
C# everywhere
AnDevCon - Android and iOS Apps in C# with Xamarin
MS Experiences 17 - Xamarin: Future of Mobile Development
.NET Fest 2018. Михаил Галушко. Искусственный интеллект на платформе Xamarin

What's hot (20)

PDF
Xamarin: Create native iOS, Android and Windows apps in C#
PDF
Visual Studio 2017 Launch Event
PPTX
Introduction to Xamarin
PPTX
Hydrogen Ellerslie dnug Xamarin
PDF
Xcoders - iOS & Android Development in C# with Xamarin
PDF
Building Your First Android App with Xamarin
KEY
Cross Platform Development with Xamarin
PPTX
Mobile development with visual studio
PPTX
Cross Platform Mobile Development with Visual Studio 2015 and C++
PPT
Cross Platform Mobile Development in C#
PPTX
PPTX
iOS Native Development with Xamarin
PPTX
Introduction to Xamarin
PPTX
Xamarin Overview
PPTX
Xamarin Open House talk - Sela Group - Ofir Makmal
PPTX
Cross Platform Mobile Development with C# and Xamarin
PPTX
C# everywhere: Xamarin and cross platform development
PPTX
Apps development for mobile devices
PDF
Write cross platform native apps in Ruby
PPTX
C# no bolso - desenvolvendo apps multiplataforma
Xamarin: Create native iOS, Android and Windows apps in C#
Visual Studio 2017 Launch Event
Introduction to Xamarin
Hydrogen Ellerslie dnug Xamarin
Xcoders - iOS & Android Development in C# with Xamarin
Building Your First Android App with Xamarin
Cross Platform Development with Xamarin
Mobile development with visual studio
Cross Platform Mobile Development with Visual Studio 2015 and C++
Cross Platform Mobile Development in C#
iOS Native Development with Xamarin
Introduction to Xamarin
Xamarin Overview
Xamarin Open House talk - Sela Group - Ofir Makmal
Cross Platform Mobile Development with C# and Xamarin
C# everywhere: Xamarin and cross platform development
Apps development for mobile devices
Write cross platform native apps in Ruby
C# no bolso - desenvolvendo apps multiplataforma
Ad

Viewers also liked (16)

PDF
IBM MobileFirst - Hybrid App Development
PPT
Most Popular Cross Platform Mobile Development Tools
PPT
360 Flex Atlanta
PPTX
Cross platform mobile developement introduction
ODP
Synapse india reviews on mobile application development
PDF
03 cross platform design
PPTX
Cross Platform Mobile Application Development Using Xamarin and C#
PPTX
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
PPT
Cross platform mobile application development
PDF
Cross Platform, Native Mobile Application Development Using Xamarin and C#
PPTX
Cross Platform Mobile Application Development
PPTX
Cross-platform mobile development: choices and limitations [IndicThreads Mob...
PDF
Cross platform web app development
PPTX
Rares Serban, Sr. Mobile Developer at Soft to you - cross-platform development
PDF
Cross Platform Mobile Development
PPTX
Hybrid Mobile App Development - Xamarin
IBM MobileFirst - Hybrid App Development
Most Popular Cross Platform Mobile Development Tools
360 Flex Atlanta
Cross platform mobile developement introduction
Synapse india reviews on mobile application development
03 cross platform design
Cross Platform Mobile Application Development Using Xamarin and C#
Amsterdam HTML5 Game Developement Meetup - ThreeDee Media presentation
Cross platform mobile application development
Cross Platform, Native Mobile Application Development Using Xamarin and C#
Cross Platform Mobile Application Development
Cross-platform mobile development: choices and limitations [IndicThreads Mob...
Cross platform web app development
Rares Serban, Sr. Mobile Developer at Soft to you - cross-platform development
Cross Platform Mobile Development
Hybrid Mobile App Development - Xamarin
Ad

Similar to Cross Platform Mobile Development with Xamarin (20)

PPT
C# rocks
PPT
Cross-Platform Mobile Development in Visual Studio
PPTX
Cross Platform Mobile Dev with C# and Xamarin 3 (RADNUG 8/19/14)
PPTX
Overview to Xamarin : Understanding Xamarin Architecture
PPTX
Cross platform mobile app development with Xamarin
PPTX
Intro to Building Mobile Apps with Xamarin
PPTX
Xamarin workshop
PDF
Introduction to Xamarin Philly Code Camp 2014
PPTX
App innovationcircles xamarin
PPTX
Designing mobile applications with xamarin
PDF
Desert code camp 2014, iOS and Android development for c# developers with Xam...
PPTX
Cross Platform Development in C# (DDDNorth 2013)
PPTX
Introduction to xamarin
PPTX
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
PPTX
Xamarin Development
PPTX
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014
PDF
MVP Mix 2015 - Introduction to Xamarin Development
PPTX
Xamarin Platform
PPTX
Introduction to Xamarin
PDF
Couchbase Workshop - Introduction to Xamarin
C# rocks
Cross-Platform Mobile Development in Visual Studio
Cross Platform Mobile Dev with C# and Xamarin 3 (RADNUG 8/19/14)
Overview to Xamarin : Understanding Xamarin Architecture
Cross platform mobile app development with Xamarin
Intro to Building Mobile Apps with Xamarin
Xamarin workshop
Introduction to Xamarin Philly Code Camp 2014
App innovationcircles xamarin
Designing mobile applications with xamarin
Desert code camp 2014, iOS and Android development for c# developers with Xam...
Cross Platform Development in C# (DDDNorth 2013)
Introduction to xamarin
SydMobDev Feb 2014 - Cross Platform Native App Development with Xamarin and M...
Xamarin Development
Cristi Ursachi - Xamarin - CodeCamp 10 may 2014
MVP Mix 2015 - Introduction to Xamarin Development
Xamarin Platform
Introduction to Xamarin
Couchbase Workshop - Introduction to Xamarin

More from bryan costanich (6)

PDF
Hardware hackers - hacking appliances with netduino + xamarin
PDF
Teardown Conference: hacking appliances with netduino + xamarin
PPTX
Hacking your coffee maker; building a connected appliance with Netduino and X...
PPTX
Futures in Computing
PPT
Advanced android app lifecycle + Patterns
KEY
Going mobile - A Technical Job Prep for Vassar Students
Hardware hackers - hacking appliances with netduino + xamarin
Teardown Conference: hacking appliances with netduino + xamarin
Hacking your coffee maker; building a connected appliance with Netduino and X...
Futures in Computing
Advanced android app lifecycle + Patterns
Going mobile - A Technical Job Prep for Vassar Students

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation theory and applications.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation theory and applications.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Approach and Philosophy of On baking technology
Encapsulation_ Review paper, used for researhc scholars
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Per capita expenditure prediction using model stacking based on satellite ima...

Cross Platform Mobile Development with Xamarin

Editor's Notes

  • #7: Fast Enough for Games Native UX means that apps look like they belong Full platform SDK Access means that anything you can do in Obj-C on iOS or Java in Android, you can do here. Animation libraries, Media libraries, etc.
  • #8: Need better graphic for this.
  • #11: Need Visual Studio Screenshot
  • #16: A good layered architecture allows for proper separation of responsibility and encapsulation, providing isolation to allow for code changes and maximizing code sharing between platforms. It also provides a pattern-agnostic framework so you can pick and choose which patterns you want to use, and then be flexible to changing them later on. And this is very simple to do. We’ll see later on how to accomplish this with proper namespacing and project setup.
  • #18: Xamarin supports portable library projects, but they pose practical problems in real-world scenarios because of dependencies. it eliminates the ability to use ifDefs, so you have to do massive architectural refactoring, use the provider/simple dependency pattern, etc. to solve even minor things. Best way, instead is to link your code.
  • #19: Don’t use .Android - the namespace will cause you hell
  • #20: You can use SQLite on all three mobile platforms, iOS, Android, and WP7. on iOS and Android, SQLite is bundled with it, and on Windows Phone, you can use the open source C# port. We’ll show later how to easily support this cross platform with the same exact API. Additionally, we recommend SQLite.NET ORM for easy data access. For Data Access, we’ve added some nice convenience methods in TaskDatabase.cs that make the basic CRUD operations a snap with zero code.
  • #21: Platforms are different. pInvoke is available on iOS and Android, not on WP. SQLite is native on Android and iOS, on WP you have to use the C# lib. Devices also have different features. Cameras are different on nearly every single android device out there. Some devices have location features, some don’t. Some vary, etc.
  • #22: There are predefined symbols that allow you to use different code, depending on the platform you’re building for. Additionally, you can define your own symbols in Build Settings. Demo of this in use can be found here: TaskyPro :: CoreLib.DataLayer/SQLite.cs
  • #23: ITask - Interface TaskBase - Task class DialogTask - with MT.D annotations