16
Cross-Platform Mobile Development Introduction to Xamarin

Binary Studio Academy 2016. Cross-Platform Mobile Development

Embed Size (px)

Citation preview

Page 1: Binary Studio Academy 2016. Cross-Platform Mobile Development

Cross-Platform Mobile Development

Introduction to Xamarin

Page 2: Binary Studio Academy 2016. Cross-Platform Mobile Development

Vitaly Ilchenko.Net Developer

binary-studio.com

Page 3: Binary Studio Academy 2016. Cross-Platform Mobile Development

Agenda

1. What is Xamarin? How does it work?

2. Suitability for use in complex projects.

3. Difference between native approach and Xamarin on the real sample.

4. What about Xamarin.Forms?

5. Results

Page 4: Binary Studio Academy 2016. Cross-Platform Mobile Development

Native approach

iOS App

Objective-CXCode

Android App

JavaAndroid Studio

Windows Phone App

C#Visual Studio

Page 5: Binary Studio Academy 2016. Cross-Platform Mobile Development

Xamarin approach

iOSApp

AndroidApp

Windows Phone App

Shared C# Code

Xamarin Studio or Visual Studio

Page 6: Binary Studio Academy 2016. Cross-Platform Mobile Development

Xamarin approach

User Interface

App Layer

Core Library

Business Layer

Service Access Layer

Data Access Layer

User Interface

App Layer

User Interface

App Layer

~ 70-90%reusable

code

Page 7: Binary Studio Academy 2016. Cross-Platform Mobile Development

iOS Project Android Project

Compilation

AOTCompile

andLink

ARM binaryRuns natively

.IPA .APK

IL + JITMono runtime

Page 8: Binary Studio Academy 2016. Cross-Platform Mobile Development

What about complex enough projects?

Internet

BLE

Windows Server

ASP.NetWCF

Web API...

Page 9: Binary Studio Academy 2016. Cross-Platform Mobile Development

Let’s make the real app

Start Stop

Latitude: 0.0

Longitude: 0.0

Updated: 00:00:00

Already available at: https://github.com/ilchenkob/Xamarin.MeetForIt

Page 10: Binary Studio Academy 2016. Cross-Platform Mobile Development

Android Application

ServicesActivitiesResources

Drawable

Models and Data Objects

Layout

Menu

Values

Activity Service

Page 11: Binary Studio Academy 2016. Cross-Platform Mobile Development

iOS Application

ViewControllerModel

Application Delegate

View Controller

UIWindow

Views and UI Objects

UI Application

Data Objects

Documents

Page 12: Binary Studio Academy 2016. Cross-Platform Mobile Development

View View

Xamarin Application for iPhone and Android

iOS ProjectCore Project (PCL)

Android Project

Model

ViewModel

ModelModel

Service Interface

Activity

ViewController

Service Implementation

Service Implementation

AppDelegate

AndroidManifest.xml

Page 13: Binary Studio Academy 2016. Cross-Platform Mobile Development

.Net support

1. Stable support of all of the .Net framework 4.5 and C# 5.0

2. Support of C# 6.0 is already done but it’s unstable

Page 14: Binary Studio Academy 2016. Cross-Platform Mobile Development

Xamarin.Forms

Core Library

Business Layer

Service Access Layer

Data Access Layer

Shared UI Code in XAML

AppLayer

AppLayer

AppLayer

Core Library

Business Layer

Service Access Layer

Data Access Layer

AppLayer

AppLayer

AppLayer

UI Layer UI Layer UI Layer

Page 15: Binary Studio Academy 2016. Cross-Platform Mobile Development

Results

1. Xamarin gives you ability to create awesome cross-platform mobile apps no worse than native tools gives.

2. Full support of .Net Framework 4.5 and C# 5.0 (stable support of C# 6.0 currently in progress).

3. If you already has .Net backend, then you can reuse big part of your code.

4. Xamarin.Forms is good but only if you don't have your own app design.

5. Sample is already available at: https://github.com/ilchenkob/Xamarin.MeetForIt

Page 16: Binary Studio Academy 2016. Cross-Platform Mobile Development

Any questions?