SlideShare a Scribd company logo
1 of 43
Building Cross-Platform
applications using Xamarin and C#
Open House – January 2014

Ofir Makmal - Senior Consultant
Email: Ofirm@sela.co.il
Blog: http://blogs.microsoft.co.il/ofirmakmal
Twitter: @OfirMakmal
LinkedIn: http://www.linkedin.com/in/ofirmakmal
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
Agenda
Mobile Market Review
iOS vs Android vs Windows (PhoneStore)
JavaScript, CSS, HTML 5 alternative
Xamarin approach
The magic behind
Cross-Platform Application Architecture
Code-Sharing ‘tactics’
Components store/open source components
Tips, tricks and others caveats
Mobile Platforms

iOS

Android

• Storyboards
• Objective C
• Xcode

• XML-based UI
• Java
• Eclipse/Android
Studio/IntelliJ IDEA

Windows
Phone/Windows
8
• XAML-based UI
• C#, VB, C++,
JavaScript
• Visual Studio
Earlier, 4%
iOS 6, 22%

OS Versions
Windows
Phone
7.x, 30%

iOS 7, 74%

Froyo
(2.2), 1.60%
Windows
Phone
8, 70%

Honeycomb
(3.x), 0.10%

KitKat
(4.4), 1.10%

Gingerbread
(2.3.x), 24.10%
ICS
(4.0.x), 18.60%

JellyBean (4.14.3), 54.50%
iOS Basic Concepts

Foundation/UIKit
View controllers
Storyboards and segues
Table views
Android Basic Concepts

Android SDK
Activities
Intents
ListViews and adapters
Windows Runtime Basic Concepts

.NET Framework
Pages
Navigation
ListViews and binding
Targeting all major platforms
Theoretically, can provide the best UX, but
Comes with a great cost
Acquire specialties with at list three different
technologies
No code sharing
Every feature, bug, needed to be implemented
several times
What's out there?
What Is PhoneGap All About?

What about performance, UX, Look&Feel?
Introducing Xamarin
Write C#. Run on 2.5 billion devices.
Xamarin
Founded in 2011 by Novell ex-employees
Based on the Mono project – launched on 2001
Brings the .NET Framework to Linux and OS X
Stable, great performance, tooling, huge code base

Xamarin took it to the next step: all major
platforms – iOS, Android, Linux, OS X
Why Xamarin?
Write in C#
Write in C#!!
100% platform API coverage
Same-day support for all new API’s
Average of 75% code sharing!
You can keep using Visual Studio
And your favorite extensions
or you can use the free Xamarin Studio

All latest C# goodness – LINQ, asyncawait, TPL
Boring, yet important
Officially partnered with Microsoft
MSDN special plans

Over 460,000 developers live, 20,000 paying
customers, 120 consulting partners
Used by more than 20% of Fortune 500 companies

Great documentation and tutorials
Very responsive community and forums
Reuse your company’s current development
investment
Demo
Xamarin stack
Where is the magic?
Xamarin.iOS - full
Ahead-of-Time (AOT)
compilation to produce
an ARM binary suitable
for Apple's App Store.
Xamarin.Android - takes
advantage of Just In
Time compilation right on
the Android device
Xamarin on iOS (monoTouch)
AOT – Ahead Of Time compilation (no JIT)
Support ARMv6, ARMv7, ARMv7s
Can use the LLVM optimizing compiler
Uses mtouch
Static analysis-based linker
Only dependent components are being compiled and
deployed
Reduce the size of the application dramatically
Can be disabled using flags (No Link, Link SDK Only) or
manually using attributes

From Apple perspective – Xamarin application is
like any other native application on the AppStore
Xamarin on Android (monoDroid)
Runs both Dalvik and CLR at the same time
Similar linker as to iOS – reduce the application
size in up to 70%
Can be disabled using flags (No Link, Link SDK
Only) or manually using attributes

Mono JIT-Compiling
Mono’s Simple Generational GC
See tips and tricks

Interaction with the OS is done using JNI (Java
Native Interface) with Managed runtime
wrappers
Xamarin Application Architecture
User Interface Designer
Android
AXml editor
All standard android UI controls
Built-in – both Visual Studio and Xamarin Studio

iOS
XCode UI designer
Storyboards also supported
Xamarin works directly with the XIB file
Integrated designer – in Alpha
Code sharing ‘tactics’
File-Linking
Using symbolic links to shared files from different
projects
Generally used with conditional compilation
directives
Can be used with partial classes and methods
Can be hard to unit-test
Requires an extra step for building the core project

Portable Class Library (PCL)
Portable Class Library
Support various deployment targets
Windows 78 Desktop apps
Windows 8 Store Apps
Windows Phone 78
Xamarin.iOS
Xamarin.Android
Xbox (partial)
Silverlight 45

All by using the same binary!
Portable Class Library – cont.
Portable Class Library – cont.
Almost every package on NuGet comes with
PCL
HttpClient
Immutable Collections
SignalR
ODataLib
RESTSharp
Json.Net
MvvmCross
TinyIoC
Protobuf-net
Many more..
MvvmCross
By far the best and most robust Mvvm
framework
Supports:
Xamarin.iOS
Xamarin.Android
Windows Phone
Windows Store Apps
WPF
Mac OS X

Navigation, IoC container, bindings, etc.. – One
stop shop
Demo
Visual Studio Integration
iOS application can be developed in Visual
Studio, but you will still need a Mac
For building the binaries
Running the simulator
Deploy to device
UI using Xcode (Interface Builder)

Works perfectly side-by-side – using remote
build and deployment
F5 on VS, the application is loaded on the iOS
simulatordevice
Visual Studio Integration – cont.
Android works within VS as any other C#
project
Simulator needs some tweaks for performance
Intel HAXM

Device deployment is the fastest
Xamarin Studio (monoDevelop)
Fully featured, modern IDE
Global type search
Code Navigation
Both Mac and Windows versions
Much more..

NuGet support
Source control
SVN / GIT are supported

Refactoring in Visual Studio is better
Generally, great IDE (really)
Demo
Xamarin.Mobile
Address book
using Xamarin.Contacts;
var contacts = new AddressBook ();

if (await book.RequestPermission()) {
contacts.OrderBy(c => c.LastName).ForEach(c => Console.WriteLine);}

Geo-Location
using Xamarin.Geolocation;
var locator = new Geolocator { DesiredAccuracy = 50 };
Position position = await locator.GetPositionAsync (timeout: 10000);
// position.Latitude, position.Longitude, etc..
PushSharp
Server-side library for sending Push
Notifications
iOS (iPhone/iPad APNS)
Android (C2DM and GCM - Google Cloud
Message)
Windows Phone
Windows 8
Amazon, Blackberry too

http://tinyurl.com/pushsharpsession
Interoperability
Use native libraries as if they were written in C#
You can wrap a driver for any specific platform and
use it in Xamarin – specific printer, scanner, etc..
iOS
Objective Sharpie – for semi-automatic wrapper
generation for Objective-C drivers

Android – set build action to AndroidNativeLibrary
and use PInvoke
Make your app Xamarin-friendly
Good separation between UI code and BL
E.g. Do not use BitmapImage on your BL

Whatever you do, do not use MEF
Abstract away the IoC implementation

Create abstractions for
system.configuration
iOS - Reflection and mtouch linker issues
Android – Large object graphs on
Java.Lang.Object subclasses
Android – Use the x86 emulator (!)

tips
Showcase
Bastion
3rd party components
There is a component for almost every need
Google Play Services
Windows Azure Mobile Services
Facebook SDK
Twitter SDK
PushSharp - TBD
RestSharp
Many more - http://components.xamarin.com/
Scan your code for conformance
scan.xamarin.com
Demo
Licensing
Getting started with Xamarin
Scan your code for conformance:
scan.xamarin.com
Download:
Trial program – 30 days
MSDN Subscription benefit – 90 days

Tons of webinars from the last conference
Great tutorials (really!)
Questions
Thank you!
If you can do it in Objective-C and Java,
you can do it in C# with Xamarin.
Ofir Makmal - Senior Consultant
Email: Ofirm@sela.co.il
Blog: http://blogs.microsoft.co.il/ofirmakmal
Twitter: @OfirMakmal
LinkedIn: http://www.linkedin.com/in/ofirmakmal

More Related Content

What's hot

C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentGill Cleeren
 
Hitchhicker's Guide to Using Xamarin Forms with RESTful Services
Hitchhicker's Guide to Using Xamarin Forms with RESTful ServicesHitchhicker's Guide to Using Xamarin Forms with RESTful Services
Hitchhicker's Guide to Using Xamarin Forms with RESTful ServicesHeather Downing
 
Intro to Building Mobile Apps with Xamarin
Intro to Building Mobile Apps with XamarinIntro to Building Mobile Apps with Xamarin
Intro to Building Mobile Apps with XamarinHeather Downing
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with Xamarinbryan costanich
 
Smaller Not Taller: Defeating the mobile application architecture giant
Smaller Not Taller: Defeating the mobile application architecture giantSmaller Not Taller: Defeating the mobile application architecture giant
Smaller Not Taller: Defeating the mobile application architecture giantHeather Downing
 
Cross platform Xamarin Apps With MVVM
Cross platform Xamarin Apps With MVVMCross platform Xamarin Apps With MVVM
Cross platform Xamarin Apps With MVVMJim Bennett
 
Say hello to Xamarin 3
Say hello to Xamarin 3Say hello to Xamarin 3
Say hello to Xamarin 3Xamarin
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamarinNish Anil
 
Hybrid Mobile Development
Hybrid Mobile DevelopmentHybrid Mobile Development
Hybrid Mobile DevelopmentShai Raiten
 
Cross platform development
Cross platform developmentCross platform development
Cross platform developmentdftaiwo
 
Cross Platform Mobile Development with C# and Xamarin
Cross Platform Mobile Development with C# and XamarinCross Platform Mobile Development with C# and Xamarin
Cross Platform Mobile Development with C# and XamarinKMS Technology
 
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveis
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveisXamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveis
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveisakamud
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with XamarinXamarin
 
Xamarin 3 hieu 19-06
Xamarin 3   hieu 19-06Xamarin 3   hieu 19-06
Xamarin 3 hieu 19-06Nguyen Hieu
 
Mobile Cross-Platform App Development in C# with Xamarin
Mobile Cross-Platform App Development in C# with XamarinMobile Cross-Platform App Development in C# with Xamarin
Mobile Cross-Platform App Development in C# with XamarinNick Landry
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarinbryan costanich
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with XamarinXpand IT
 
Building Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioBuilding Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioXamarin
 
Xamarin Cross-Platform with Xamarin.Form, MvvmCross
Xamarin Cross-Platform with Xamarin.Form, MvvmCrossXamarin Cross-Platform with Xamarin.Form, MvvmCross
Xamarin Cross-Platform with Xamarin.Form, MvvmCrossTri Nguyen
 

What's hot (20)

C# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform developmentC# everywhere: Xamarin and cross platform development
C# everywhere: Xamarin and cross platform development
 
Hitchhicker's Guide to Using Xamarin Forms with RESTful Services
Hitchhicker's Guide to Using Xamarin Forms with RESTful ServicesHitchhicker's Guide to Using Xamarin Forms with RESTful Services
Hitchhicker's Guide to Using Xamarin Forms with RESTful Services
 
Intro to Building Mobile Apps with Xamarin
Intro to Building Mobile Apps with XamarinIntro to Building Mobile Apps with Xamarin
Intro to Building Mobile Apps with Xamarin
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with Xamarin
 
Smaller Not Taller: Defeating the mobile application architecture giant
Smaller Not Taller: Defeating the mobile application architecture giantSmaller Not Taller: Defeating the mobile application architecture giant
Smaller Not Taller: Defeating the mobile application architecture giant
 
Cross platform Xamarin Apps With MVVM
Cross platform Xamarin Apps With MVVMCross platform Xamarin Apps With MVVM
Cross platform Xamarin Apps With MVVM
 
Say hello to Xamarin 3
Say hello to Xamarin 3Say hello to Xamarin 3
Say hello to Xamarin 3
 
iOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using XamariniOS & Android Dev in C# & Visual Studio using Xamarin
iOS & Android Dev in C# & Visual Studio using Xamarin
 
Hybrid Mobile Development
Hybrid Mobile DevelopmentHybrid Mobile Development
Hybrid Mobile Development
 
Cross platform development
Cross platform developmentCross platform development
Cross platform development
 
Cross Platform Mobile Development with C# and Xamarin
Cross Platform Mobile Development with C# and XamarinCross Platform Mobile Development with C# and Xamarin
Cross Platform Mobile Development with C# and Xamarin
 
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveis
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveisXamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveis
Xamarin Forms: O caminho para 100% de código compartilhado em aplicativos móveis
 
Building Your First Android App with Xamarin
Building Your First Android App with XamarinBuilding Your First Android App with Xamarin
Building Your First Android App with Xamarin
 
Xamarin 3 hieu 19-06
Xamarin 3   hieu 19-06Xamarin 3   hieu 19-06
Xamarin 3 hieu 19-06
 
Mobile Cross-Platform App Development in C# with Xamarin
Mobile Cross-Platform App Development in C# with XamarinMobile Cross-Platform App Development in C# with Xamarin
Mobile Cross-Platform App Development in C# with Xamarin
 
Cross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with XamarinCross Platform Mobile Development with Xamarin
Cross Platform Mobile Development with Xamarin
 
Cross Platform Development with Xamarin
Cross Platform Development with XamarinCross Platform Development with Xamarin
Cross Platform Development with Xamarin
 
Building Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual StudioBuilding Your First iOS App with Xamarin for Visual Studio
Building Your First iOS App with Xamarin for Visual Studio
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Xamarin Cross-Platform with Xamarin.Form, MvvmCross
Xamarin Cross-Platform with Xamarin.Form, MvvmCrossXamarin Cross-Platform with Xamarin.Form, MvvmCross
Xamarin Cross-Platform with Xamarin.Form, MvvmCross
 

Viewers also liked

Mastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionMastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionSasha Goldshtein
 
Kế toán tập hợp chi phí và tính giá thành sản phẩm
Kế toán tập hợp chi phí và tính giá thành sản phẩmKế toán tập hợp chi phí và tính giá thành sản phẩm
Kế toán tập hợp chi phí và tính giá thành sản phẩmTrang Thu
 
Phân tích mức hạ giá thành sản phẩm
Phân tích mức hạ giá thành sản phẩmPhân tích mức hạ giá thành sản phẩm
Phân tích mức hạ giá thành sản phẩmĐinh Thị Vân
 
giáo trình kế toán quản trị P1
giáo trình kế toán quản trị P1giáo trình kế toán quản trị P1
giáo trình kế toán quản trị P1Nguyen Phuong Thao
 
Bài tập kế toán chi phí có lời giải đáp án
Bài tập kế toán chi phí có lời giải đáp ánBài tập kế toán chi phí có lời giải đáp án
Bài tập kế toán chi phí có lời giải đáp ánÁc Quỷ Lộng Hành
 
Một số phương pháp tính giá thành sản phẩm chủ yếu
Một số phương pháp tính giá thành sản phẩm chủ yếuMột số phương pháp tính giá thành sản phẩm chủ yếu
Một số phương pháp tính giá thành sản phẩm chủ yếuHiển Phùng
 
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)Học Huỳnh Bá
 

Viewers also liked (9)

Xa hoi-hoc
Xa hoi-hocXa hoi-hoc
Xa hoi-hoc
 
Mastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and ProductionMastering IntelliTrace in Development and Production
Mastering IntelliTrace in Development and Production
 
Kế toán tập hợp chi phí và tính giá thành sản phẩm
Kế toán tập hợp chi phí và tính giá thành sản phẩmKế toán tập hợp chi phí và tính giá thành sản phẩm
Kế toán tập hợp chi phí và tính giá thành sản phẩm
 
Phân tích mức hạ giá thành sản phẩm
Phân tích mức hạ giá thành sản phẩmPhân tích mức hạ giá thành sản phẩm
Phân tích mức hạ giá thành sản phẩm
 
giáo trình kế toán quản trị P1
giáo trình kế toán quản trị P1giáo trình kế toán quản trị P1
giáo trình kế toán quản trị P1
 
Bài tập kế toán chi phí có lời giải đáp án
Bài tập kế toán chi phí có lời giải đáp ánBài tập kế toán chi phí có lời giải đáp án
Bài tập kế toán chi phí có lời giải đáp án
 
Một số phương pháp tính giá thành sản phẩm chủ yếu
Một số phương pháp tính giá thành sản phẩm chủ yếuMột số phương pháp tính giá thành sản phẩm chủ yếu
Một số phương pháp tính giá thành sản phẩm chủ yếu
 
Bài tập kế toán chi phí và lời giải
Bài tập kế toán chi phí và lời giảiBài tập kế toán chi phí và lời giải
Bài tập kế toán chi phí và lời giải
 
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)
BÀI TẬP KẾ TOÁN CHI PHÍ (CÓ LỜI GIẢI)
 

Similar to Xamarin Open House talk - Sela Group - Ofir Makmal

Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
Building Mobile Cross-Platform Apps foriOS, Android & Windows in C# with Xam...Building Mobile Cross-Platform Apps foriOS, Android & Windows in C# with Xam...
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...Nick Landry
 
Cross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and XamarinCross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and XamarinShravan Kumar Kasagoni
 
Xamarin cross platform
Xamarin cross platformXamarin cross platform
Xamarin cross platformGuada Casuso
 
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCrossBuild Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCrossIshai Hachlili
 
Native iOS and Android Development with Xamarin
Native iOS and Android Development with XamarinNative iOS and Android Development with Xamarin
Native iOS and Android Development with XamarinJames Montemagno
 
Cross platform mobile app development tools review
Cross platform mobile app development tools reviewCross platform mobile app development tools review
Cross platform mobile app development tools reviewUday Kothari
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google DevsCraig Dunn
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to XamarinGuy Barrette
 
Going Mobile with C#, Visual Studio, and Xamarin
Going Mobile with C#, Visual Studio, and XamarinGoing Mobile with C#, Visual Studio, and Xamarin
Going Mobile with C#, Visual Studio, and XamarinMatthew Soucoup
 
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...James Montemagno
 
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondState of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondNick Landry
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarinDaniel Fikre
 
Designing mobile applications with xamarin
Designing mobile applications with xamarinDesigning mobile applications with xamarin
Designing mobile applications with xamarinJerel Hass
 
Cross platform mobile development with xamarin and office 365
Cross platform mobile development with xamarin and office 365Cross platform mobile development with xamarin and office 365
Cross platform mobile development with xamarin and office 365SoHo Dragon
 

Similar to Xamarin Open House talk - Sela Group - Ofir Makmal (20)

Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
Building Mobile Cross-Platform Apps foriOS, Android & Windows in C# with Xam...Building Mobile Cross-Platform Apps foriOS, Android & Windows in C# with Xam...
Building Mobile Cross-Platform Apps for iOS, Android & Windows in C# with Xam...
 
Xamarin介紹
Xamarin介紹Xamarin介紹
Xamarin介紹
 
Cross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and XamarinCross-Platform Mobile Development using Visual Studio and Xamarin
Cross-Platform Mobile Development using Visual Studio and Xamarin
 
Xamarin cross platform
Xamarin cross platformXamarin cross platform
Xamarin cross platform
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCrossBuild Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
Build Cross Platform Mobile Apps for iOS & Android with Xamarin & MvvmCross
 
Xamarin Development
Xamarin DevelopmentXamarin Development
Xamarin Development
 
Native iOS and Android Development with Xamarin
Native iOS and Android Development with XamarinNative iOS and Android Development with Xamarin
Native iOS and Android Development with Xamarin
 
Cross platform mobile app development tools review
Cross platform mobile app development tools reviewCross platform mobile app development tools review
Cross platform mobile app development tools review
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Xamarin the good, the bad and the ugly
Xamarin  the good, the bad and the uglyXamarin  the good, the bad and the ugly
Xamarin the good, the bad and the ugly
 
Introduction to xamarin
Introduction to xamarin  Introduction to xamarin
Introduction to xamarin
 
Mono for Android... for Google Devs
Mono for Android... for Google DevsMono for Android... for Google Devs
Mono for Android... for Google Devs
 
Introduction to Xamarin
Introduction to XamarinIntroduction to Xamarin
Introduction to Xamarin
 
Going Mobile with C#, Visual Studio, and Xamarin
Going Mobile with C#, Visual Studio, and XamarinGoing Mobile with C#, Visual Studio, and Xamarin
Going Mobile with C#, Visual Studio, and Xamarin
 
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...
TechEd Europ 2014 DEV-B306 Building Multi-Device Applications with Xamarin an...
 
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and BeyondState of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
 
Introduction to xamarin
Introduction to xamarinIntroduction to xamarin
Introduction to xamarin
 
Designing mobile applications with xamarin
Designing mobile applications with xamarinDesigning mobile applications with xamarin
Designing mobile applications with xamarin
 
Cross platform mobile development with xamarin and office 365
Cross platform mobile development with xamarin and office 365Cross platform mobile development with xamarin and office 365
Cross platform mobile development with xamarin and office 365
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Xamarin Open House talk - Sela Group - Ofir Makmal

  • 1. Building Cross-Platform applications using Xamarin and C# Open House – January 2014 Ofir Makmal - Senior Consultant Email: Ofirm@sela.co.il Blog: http://blogs.microsoft.co.il/ofirmakmal Twitter: @OfirMakmal LinkedIn: http://www.linkedin.com/in/ofirmakmal © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
  • 2. Agenda Mobile Market Review iOS vs Android vs Windows (PhoneStore) JavaScript, CSS, HTML 5 alternative Xamarin approach The magic behind Cross-Platform Application Architecture Code-Sharing ‘tactics’ Components store/open source components Tips, tricks and others caveats
  • 3. Mobile Platforms iOS Android • Storyboards • Objective C • Xcode • XML-based UI • Java • Eclipse/Android Studio/IntelliJ IDEA Windows Phone/Windows 8 • XAML-based UI • C#, VB, C++, JavaScript • Visual Studio
  • 4. Earlier, 4% iOS 6, 22% OS Versions Windows Phone 7.x, 30% iOS 7, 74% Froyo (2.2), 1.60% Windows Phone 8, 70% Honeycomb (3.x), 0.10% KitKat (4.4), 1.10% Gingerbread (2.3.x), 24.10% ICS (4.0.x), 18.60% JellyBean (4.14.3), 54.50%
  • 5. iOS Basic Concepts Foundation/UIKit View controllers Storyboards and segues Table views
  • 6. Android Basic Concepts Android SDK Activities Intents ListViews and adapters
  • 7. Windows Runtime Basic Concepts .NET Framework Pages Navigation ListViews and binding
  • 8. Targeting all major platforms Theoretically, can provide the best UX, but Comes with a great cost Acquire specialties with at list three different technologies No code sharing Every feature, bug, needed to be implemented several times
  • 10. What Is PhoneGap All About? What about performance, UX, Look&Feel?
  • 11. Introducing Xamarin Write C#. Run on 2.5 billion devices.
  • 12. Xamarin Founded in 2011 by Novell ex-employees Based on the Mono project – launched on 2001 Brings the .NET Framework to Linux and OS X Stable, great performance, tooling, huge code base Xamarin took it to the next step: all major platforms – iOS, Android, Linux, OS X
  • 13. Why Xamarin? Write in C# Write in C#!! 100% platform API coverage Same-day support for all new API’s Average of 75% code sharing! You can keep using Visual Studio And your favorite extensions or you can use the free Xamarin Studio All latest C# goodness – LINQ, asyncawait, TPL
  • 14. Boring, yet important Officially partnered with Microsoft MSDN special plans Over 460,000 developers live, 20,000 paying customers, 120 consulting partners Used by more than 20% of Fortune 500 companies Great documentation and tutorials Very responsive community and forums Reuse your company’s current development investment
  • 15. Demo
  • 17. Where is the magic? Xamarin.iOS - full Ahead-of-Time (AOT) compilation to produce an ARM binary suitable for Apple's App Store. Xamarin.Android - takes advantage of Just In Time compilation right on the Android device
  • 18. Xamarin on iOS (monoTouch) AOT – Ahead Of Time compilation (no JIT) Support ARMv6, ARMv7, ARMv7s Can use the LLVM optimizing compiler Uses mtouch Static analysis-based linker Only dependent components are being compiled and deployed Reduce the size of the application dramatically Can be disabled using flags (No Link, Link SDK Only) or manually using attributes From Apple perspective – Xamarin application is like any other native application on the AppStore
  • 19. Xamarin on Android (monoDroid) Runs both Dalvik and CLR at the same time Similar linker as to iOS – reduce the application size in up to 70% Can be disabled using flags (No Link, Link SDK Only) or manually using attributes Mono JIT-Compiling Mono’s Simple Generational GC See tips and tricks Interaction with the OS is done using JNI (Java Native Interface) with Managed runtime wrappers
  • 21. User Interface Designer Android AXml editor All standard android UI controls Built-in – both Visual Studio and Xamarin Studio iOS XCode UI designer Storyboards also supported Xamarin works directly with the XIB file Integrated designer – in Alpha
  • 22. Code sharing ‘tactics’ File-Linking Using symbolic links to shared files from different projects Generally used with conditional compilation directives Can be used with partial classes and methods Can be hard to unit-test Requires an extra step for building the core project Portable Class Library (PCL)
  • 23. Portable Class Library Support various deployment targets Windows 78 Desktop apps Windows 8 Store Apps Windows Phone 78 Xamarin.iOS Xamarin.Android Xbox (partial) Silverlight 45 All by using the same binary!
  • 25. Portable Class Library – cont. Almost every package on NuGet comes with PCL HttpClient Immutable Collections SignalR ODataLib RESTSharp Json.Net MvvmCross TinyIoC Protobuf-net Many more..
  • 26. MvvmCross By far the best and most robust Mvvm framework Supports: Xamarin.iOS Xamarin.Android Windows Phone Windows Store Apps WPF Mac OS X Navigation, IoC container, bindings, etc.. – One stop shop
  • 27. Demo
  • 28. Visual Studio Integration iOS application can be developed in Visual Studio, but you will still need a Mac For building the binaries Running the simulator Deploy to device UI using Xcode (Interface Builder) Works perfectly side-by-side – using remote build and deployment F5 on VS, the application is loaded on the iOS simulatordevice
  • 29. Visual Studio Integration – cont. Android works within VS as any other C# project Simulator needs some tweaks for performance Intel HAXM Device deployment is the fastest
  • 30. Xamarin Studio (monoDevelop) Fully featured, modern IDE Global type search Code Navigation Both Mac and Windows versions Much more.. NuGet support Source control SVN / GIT are supported Refactoring in Visual Studio is better Generally, great IDE (really)
  • 31. Demo
  • 32. Xamarin.Mobile Address book using Xamarin.Contacts; var contacts = new AddressBook (); if (await book.RequestPermission()) { contacts.OrderBy(c => c.LastName).ForEach(c => Console.WriteLine);} Geo-Location using Xamarin.Geolocation; var locator = new Geolocator { DesiredAccuracy = 50 }; Position position = await locator.GetPositionAsync (timeout: 10000); // position.Latitude, position.Longitude, etc..
  • 33. PushSharp Server-side library for sending Push Notifications iOS (iPhone/iPad APNS) Android (C2DM and GCM - Google Cloud Message) Windows Phone Windows 8 Amazon, Blackberry too http://tinyurl.com/pushsharpsession
  • 34. Interoperability Use native libraries as if they were written in C# You can wrap a driver for any specific platform and use it in Xamarin – specific printer, scanner, etc.. iOS Objective Sharpie – for semi-automatic wrapper generation for Objective-C drivers Android – set build action to AndroidNativeLibrary and use PInvoke
  • 35. Make your app Xamarin-friendly Good separation between UI code and BL E.g. Do not use BitmapImage on your BL Whatever you do, do not use MEF Abstract away the IoC implementation Create abstractions for system.configuration iOS - Reflection and mtouch linker issues Android – Large object graphs on Java.Lang.Object subclasses Android – Use the x86 emulator (!) tips
  • 37. 3rd party components There is a component for almost every need Google Play Services Windows Azure Mobile Services Facebook SDK Twitter SDK PushSharp - TBD RestSharp Many more - http://components.xamarin.com/
  • 38. Scan your code for conformance scan.xamarin.com
  • 39. Demo
  • 41. Getting started with Xamarin Scan your code for conformance: scan.xamarin.com Download: Trial program – 30 days MSDN Subscription benefit – 90 days Tons of webinars from the last conference Great tutorials (really!)
  • 43. Thank you! If you can do it in Objective-C and Java, you can do it in C# with Xamarin. Ofir Makmal - Senior Consultant Email: Ofirm@sela.co.il Blog: http://blogs.microsoft.co.il/ofirmakmal Twitter: @OfirMakmal LinkedIn: http://www.linkedin.com/in/ofirmakmal

Editor's Notes

  1. Titanium – Cross-platform JS runtime and api – with generated components for native experiencePhoneGap/Cordoba – Cross-platform JS runtime and api - JS, CSS, HTML Hybrid applicationsSencha – JS, CSS, HTML application with no apiCorona – mostly focusing on games, using Lua scripting language
  2. Ximian – Novell – Attachmate
  3. Demo application – SDP\Tasky?
  4. ThreeDemos, and short code structure review.Core:platform-specific abstractions, models, services, ViewModels, BL, IoC, Navigation service, cache, local DB, JSON/serialization, communication, loggingApplication Specific: Bindings, Animations, specific OS functionality