M.I. Isham Mohamed
Intro to Cross Platform
Native apps development
With Xamarin
Xamarin Student Ambassador
Undergraduate intern
IFS
@isham_m_iqbal
http://ishammohamed.me
http://programmium.wordpress.com
http”//github.com/ishammohamed
Java and Java
• Java, the language.
• Java, the platform.
C# and .NET
• C#, the language.
• .NET, the platform.
Understand .NET
• It’s a framework, platform & environment not
language
– You build code using .NET framework (equals
.NET libraries)
– The code runs on the .NET platform (in the CLR)
– You need to install .NET environment (.NET
framework redistributable)
Understand .NET
C# vs Java
• Both are good, better and best on their
own aspects.
• C# has continued to evolve and emerging.
• C# is faster than Java on Windows kernel,
while Java can run on any – Before 2004.
• Now C# can run on any – Thanks Mono.
Wait.. an interesting statData types Java C#
Single-root (unified) type system No; but wrapper types Yes[1]
Signed integers Yes; 8, 16, 32, 64 bits Yes; 8, 16, 32, 64 bits
Unsigned integers No; but some method support.[2]
Yes; 8, 16, 32, 64 bits
Character Yes[3]
Yes
Date/time Yes; reference type[4]
Yes; value type
IEEE 754 binary32 floating point number Yes Yes
IEEE 754 binary64 floating point number Yes Yes
Boolean type Yes Yes
High precision decimal number No; but see 'Arbitrary size decimals' below 128-bit (28 digits) Decimal type
Arbitrary size decimals Reference type; no operators[5]
No
Strings Immutable reference type, Unicode Immutable reference type, Unicode
Arbitrary size integers Reference type; no operators Yes[6]
Complex numbers No Yes
Reference types Yes Yes
Arrays Yes[7]
Yes
Value types No; only primitive types Yes
Type annotations Yes Yes
Enumerated types Yes; reference type Yes; scalar
Lifted (nullable) types No; but wrapper types Yes
Tuples No; limited 3rd party available.[8]
No; but standard library support with limited arity
Pointers No;[9]
only method references [10]
Yes[11]
You all would like to
become mobile
developers
Targeting only one
platform is not a good
solution for your app.
You could become a
better mobile app
developer solution
developer.
Major platforms
Platform NativeLanguage Cloud & Push Services
iOS Objective C, Swift iCloud, APN
Android Java Google Play Games,
Google Fit, Google
Cloud, GPN…. And more
Windows Phone C#, C++, F# Azure, WPNS
How to target all
platforms
Silo approach
• The present approach adopted by 90%
of the app dev companies.
• Separate teams for separate platforms
for the same app.
• Can achieve true nativity.
• Costly.
• Ex – Facebook, Twitter, Foursquare apps
in iOS, Android and Windows Phone.
HTML5 approach
• Bit earlier approach.
• How many of us remember the awful
Facebook app for Android in 2009.
• In Sri Lanka, most people do this kind
of silly work.
• Very low cost.
• Even Microsoft gave a big support to
this until last year.
• Now mostly they support native.
(and still this)
• Ex – Yamu.lk, some good games.
HTML5 approach
HTML5 approach
No magic..!
Generate a HTML5
web page
Make an
(Android/iOS/WP)
app with WebView
control
Load the web page
created on the
WebView and
deliver the app..
Xamarin approach
• Real definition of Cross platform.
• Share the same code & logic
among platforms.
• The FUTURE of mobile
programming.
• Being adopted rapidly.
• NATIVE.. NATIVE.. NATIVE..
• Low Cost.
• Robustness maintained.
Xamarin C# Shared
backend
{iOS}
C# UI
{Android}
C# UI
{Windows}
C# UI
Windows APIs
iOS APIs
Android APIs
How Xamarin makes iOS apps
.app
.NET
C#
Bindings
How Xamarin makes Android apps
.apk
.NET
C#
Bindings
Requirements
• Xamarin Subscription
– This comes with Xamarin Studio
• Xcode and VS supported
Hello boss.. We know Java well
Big 0
Xamarin Starter License
• Free..*
http://xamarin.com/starter
*conditions apply
Xamarin Student License
• Free..!!
https://www.dreamspark.com/Product/Product.aspx?productid=100
*conditions apply
The T-Shirt I am wearing
• Free..!!!!!
https://xamarin.com/c-sharp-shirt
*conditions apply
DEMO

Introduction to Xamarin Development

  • 1.
    M.I. Isham Mohamed Introto Cross Platform Native apps development With Xamarin
  • 2.
    Xamarin Student Ambassador Undergraduateintern IFS @isham_m_iqbal http://ishammohamed.me http://programmium.wordpress.com http”//github.com/ishammohamed
  • 3.
    Java and Java •Java, the language. • Java, the platform.
  • 4.
    C# and .NET •C#, the language. • .NET, the platform.
  • 5.
    Understand .NET • It’sa framework, platform & environment not language – You build code using .NET framework (equals .NET libraries) – The code runs on the .NET platform (in the CLR) – You need to install .NET environment (.NET framework redistributable)
  • 6.
  • 7.
    C# vs Java •Both are good, better and best on their own aspects. • C# has continued to evolve and emerging. • C# is faster than Java on Windows kernel, while Java can run on any – Before 2004. • Now C# can run on any – Thanks Mono.
  • 8.
    Wait.. an interestingstatData types Java C# Single-root (unified) type system No; but wrapper types Yes[1] Signed integers Yes; 8, 16, 32, 64 bits Yes; 8, 16, 32, 64 bits Unsigned integers No; but some method support.[2] Yes; 8, 16, 32, 64 bits Character Yes[3] Yes Date/time Yes; reference type[4] Yes; value type IEEE 754 binary32 floating point number Yes Yes IEEE 754 binary64 floating point number Yes Yes Boolean type Yes Yes High precision decimal number No; but see 'Arbitrary size decimals' below 128-bit (28 digits) Decimal type Arbitrary size decimals Reference type; no operators[5] No Strings Immutable reference type, Unicode Immutable reference type, Unicode Arbitrary size integers Reference type; no operators Yes[6] Complex numbers No Yes Reference types Yes Yes Arrays Yes[7] Yes Value types No; only primitive types Yes Type annotations Yes Yes Enumerated types Yes; reference type Yes; scalar Lifted (nullable) types No; but wrapper types Yes Tuples No; limited 3rd party available.[8] No; but standard library support with limited arity Pointers No;[9] only method references [10] Yes[11]
  • 9.
    You all wouldlike to become mobile developers
  • 10.
    Targeting only one platformis not a good solution for your app.
  • 11.
    You could becomea better mobile app developer solution developer.
  • 12.
    Major platforms Platform NativeLanguageCloud & Push Services iOS Objective C, Swift iCloud, APN Android Java Google Play Games, Google Fit, Google Cloud, GPN…. And more Windows Phone C#, C++, F# Azure, WPNS
  • 13.
    How to targetall platforms
  • 14.
    Silo approach • Thepresent approach adopted by 90% of the app dev companies. • Separate teams for separate platforms for the same app. • Can achieve true nativity. • Costly. • Ex – Facebook, Twitter, Foursquare apps in iOS, Android and Windows Phone.
  • 15.
    HTML5 approach • Bitearlier approach. • How many of us remember the awful Facebook app for Android in 2009. • In Sri Lanka, most people do this kind of silly work. • Very low cost. • Even Microsoft gave a big support to this until last year. • Now mostly they support native. (and still this) • Ex – Yamu.lk, some good games.
  • 16.
  • 17.
    HTML5 approach No magic..! Generatea HTML5 web page Make an (Android/iOS/WP) app with WebView control Load the web page created on the WebView and deliver the app..
  • 18.
    Xamarin approach • Realdefinition of Cross platform. • Share the same code & logic among platforms. • The FUTURE of mobile programming. • Being adopted rapidly. • NATIVE.. NATIVE.. NATIVE.. • Low Cost. • Robustness maintained. Xamarin C# Shared backend {iOS} C# UI {Android} C# UI {Windows} C# UI
  • 20.
  • 21.
  • 22.
  • 23.
    How Xamarin makesiOS apps .app .NET C# Bindings
  • 24.
    How Xamarin makesAndroid apps .apk .NET C# Bindings
  • 25.
    Requirements • Xamarin Subscription –This comes with Xamarin Studio • Xcode and VS supported
  • 26.
    Hello boss.. Weknow Java well Big 0
  • 27.
    Xamarin Starter License •Free..* http://xamarin.com/starter *conditions apply
  • 28.
    Xamarin Student License •Free..!! https://www.dreamspark.com/Product/Product.aspx?productid=100 *conditions apply
  • 29.
    The T-Shirt Iam wearing • Free..!!!!! https://xamarin.com/c-sharp-shirt *conditions apply
  • 30.

Editor's Notes

  • #6 You build code using .NET framework (equals .NET libraries) The code runs on the .NET platform (in the CLR) You need to install .NET environment (.NET framework redistributable)
  • #9 http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
  • #15 Talk about the push notifications also here
  • #16 Since HTML 5 and JS, AWS and Azure support JS mobile services.
  • #19 When it comes to cloud, Xamarin has its own cloud service and own testing service as well. But since C# is the shared language we can use Azure as comparing to Azure Xamarin cloud is bit expensive.
  • #21 .Phone – the namespace has classes for background task and native picture decosing .networking – networking related api, contains classes to control hostname, ip and more .storage – provide classes to store and open files from the device’s storage and SD card .foundation – control windows runtime fundamentals, control async tasks and working with images and URIs .devices - Contains information related to the hardware of Windows Phone devices. System.Net… those are for C# and they are common to all platforms..
  • #22 We call these are frameworks.. Like namespaces for Windows C# Mapkit - provides an interface for embedding maps directly into your own windows and views. Provide supports to adding overlays, and performing reverse-geocoding lookups to determine placemark information for a given map coordinate. Uikit - provides the window and view architecture needed to manage an app’s user interface, the event handling and app model iBeacon - iBeacon is the trademark for an indoor positioning system Coregraphics – frameworkd for rendering graphics Coremotion - receive motion data from device hardware
  • #23 Tts – tts Action bar – like a title bar for app, determne where user is in the app and give him support. Printing Framework – a framework that support hardcopy printing Renderscript - RenderScript provides a platform-independent computation engine that operates at the native level. Use it to accelerate your apps that require extensive computational horsepower. Remember iOS and Android has 100% ported APIs to Xamarin.
  • #25 IL Code stands for Intermediate Language Code. It is a CPU independent partially compiled code. JIT stands for Just In Timer Compiler. It is the internal compiler of .NET which takes IL code from CLR and executes it to machine specific instructions.
  • #26 Next slide is.. The answer to Java peeps…
  • #27 What matters at the end of the day is (press enter now) BIG O.. The faster your code runs…