Download pdf - Tcdnug xamarin

Transcript
Page 1: Tcdnug xamarin

CROSS PLATFORM DEVELOPMENT WITH XAMARIN TOOLSJoe KoletarMobile Solution Lead - Application Development

Page 2: Tcdnug xamarin

RBA

Microsoft National Systems Integrator

Gold Certified Microsoft Partner 7 Gold Competencies6 Silver Competencies

Named Best Places to Work in the Twin Cities 4 times

Xamarin Premier Partner

CROSS PLATFORM MOBILE DEVELOPMENTP:2

Joe Koletar

Mobile Solutions Lead

[email protected]

Page 3: Tcdnug xamarin

MOBILE DEVICE OPPORTUNITY

Opportunity– Mobile devices present an opportunity to reach users

where its most convenient • Business to Consumer (B2C) Applications

• Business to Business (B2B) Applications

Challenge– How to develop applications to reach the broadest

range of users in the most effective manner possible for the least cost

CROSS PLATFORM MOBILE DEVELOPMENTP:3

Page 4: Tcdnug xamarin

CROSS PLATFORM TOOL OPTIONS

There are a spectrum of technology options to provide cross platform support for enterprise apps

CROSS PLATFORM MOBILE DEVELOPMENTP:4

Cross Platform Solutions

Mobile

Web

Native

WrapperInterpreted

Cross

CompiledNative

Page 5: Tcdnug xamarin

MOBILE WEBDefinition

Web site with a mobile customized UI

– Detect user device and customize display to device form factor

• Responsive Design

– HTML 5 encourages a common browser experience and provides some offline support

CROSS PLATFORM MOBILE DEVELOPMENTP:5

Page 6: Tcdnug xamarin

MOBILE WEBHow it works

Users access web site from device browser

CROSS PLATFORM MOBILE DEVELOPMENTP:6

iOS

Web Browser

Android

Web Browser

Windows Phone

Web Browser

Business/Data Code

HTML5/CSS/JavaScript

Page 7: Tcdnug xamarin

MOBILE WEB

CROSS PLATFORM MOBILE DEVELOPMENTP:7

Cost

Maintainability

User Experience

Offline Capability

Sensors

Toolset Choices

Performance

Page 8: Tcdnug xamarin

NATIVE APPDefinition

Native App is written custom for each device

CROSS PLATFORM MOBILE DEVELOPMENTP:8

Page 9: Tcdnug xamarin

NATIVE APPHow it works

Native App is written custom for each platform

CROSS PLATFORM MOBILE DEVELOPMENTP:9

iOS

Native App

Android

Native App

Windows Phone

Native App

Objective C Java C#

Page 10: Tcdnug xamarin

NATIVE APP

CROSS PLATFORM MOBILE DEVELOPMENTP:10

Cost

Maintainability

User Experience

Offline Capability

Sensors

Toolset Choices

Performance

Page 11: Tcdnug xamarin

NATIVE WRAPPERDefinition

Web App is wrapped in device specific code to run as a Native App

– Web app is hosted in a chromeless browser window.

CROSS PLATFORM MOBILE DEVELOPMENTP:11

Page 12: Tcdnug xamarin

NATIVE WRAPPERHow it works

Web App is wrapped in device specific code

– Access to sensors is achieved through a bridge

CROSS PLATFORM MOBILE DEVELOPMENTP:12

HTML5/CSS/JavaScript

Android

Web View

Bridge

Native API

iOS

Web View

Bridge

Native API

Windows Phone

Web View

Bridge

Native API

Page 13: Tcdnug xamarin

NATIVE WRAPPER

CROSS PLATFORM MOBILE DEVELOPMENTP:13

Cost

Maintainability

User Experience

Offline Capability

Sensors

Toolset Choices

Performance

Page 14: Tcdnug xamarin

INTERPRETEDDefinition

Interpreted applications map a common language to platform specific APIs

– Abstraction layer is provided on top of the native API

– Code is written to run on the abstraction layer

CROSS PLATFORM MOBILE DEVELOPMENTP:14

Page 15: Tcdnug xamarin

INTERPRETEDHow it works

Application is written in scripting language

Script proxies provide access to native widgets

CROSS PLATFORM MOBILE DEVELOPMENTP:15

JavaScript

Android

Script

Interpreter

Native API

Windows Phone

Script

Interpreter

Native API

iOS

Script

Interpreter

Native API

Page 16: Tcdnug xamarin

INTERPRETED

CROSS PLATFORM MOBILE DEVELOPMENTP:16

Cost

Maintainability

User Experience

Offline Capability

Sensors

Toolset Choices

Performance

Page 17: Tcdnug xamarin

CROSS COMPILEDDefinition

Cross compiled applications map a common language to platform specific languages

CROSS PLATFORM MOBILE DEVELOPMENTP:17

Page 18: Tcdnug xamarin

CROSS COMPILEDHow it works

Common business logic is combined with platform specific UI code into native app

CROSS PLATFORM MOBILE DEVELOPMENTP:18

iOS

Native App

Android

Native App

Windows Phone

Native App

C# Business/Data Code

C# iOS UI C# Android UI C# Win Phone UI

Page 19: Tcdnug xamarin

CROSS COMPILED

CROSS PLATFORM MOBILE DEVELOPMENTP:19

Cost

Maintainability

User Experience

Offline Capability

Sensors

Toolset Choices

Performance

Page 20: Tcdnug xamarin

XAMARIN TOOLS – A DEEPER LOOK

Allows programming C# to iOS and Android– Access to .NET Base Libraries– Full featured language support:

• LINQ• Generics• Task Parallel Library• Lambdas

– C# 5.0 support targeted for March• Async feature

C# bindings for nearly the entire underlying platform SDKs– UI code is platform specific– Supports native User Experience– Also imposes a learning curve

XAMARIN TOOLSP:20

Page 21: Tcdnug xamarin

XAMARIN – HOW IT WORKS

Built on top of Mono

Open source version of the .NET Framework

Ported to numerous platforms

On Android, Xamarin’s compiler compiles down to Intermediate Language (IL), which is then Just-in-Time (JIT) compiled to native assembly when the application launches.

On iOS, Xamarin’s Ahead-of-Time (AOT) compiler compiles Xamarin.iOS applications directly to native ARM assembly code.

XAMARIN TOOLSP:21

Page 22: Tcdnug xamarin

XAMARIN PRODUCTS

Mono for Android– Targets Android platform– Can code in either Visual Studio or MonoDevelop

MonoTouch– Targets iOS platform– Requires Macintosh computer running at least OSX Lion– Can code in MonoDevelop

Free Trial versions do not support deployment to device– Must perform testing in an emulator/simulator

XAMARIN TOOLSP:22

Page 23: Tcdnug xamarin

XAMARIN DEMO

XAMARIN TOOLSP:23

Page 24: Tcdnug xamarin

ANDROID LAYOUT

XAMARIN TOOLSP:24

Page 25: Tcdnug xamarin

XAMARIN ARCHITECTURE

TaskyPro Architecture across platforms

XAMARIN TOOLSP:25

Page 26: Tcdnug xamarin

XAMARIN LINKS

Download trial software at:– http://xamarin.com/trial

TaskyPro Source Code– https://github.com/xamarin/mobile-samples/tree/master/TaskyPro

TaskyPro Case Study– http://docs.xamarin.com/Android/Guides/Application_Fundamentals/B

uilding_Cross_Platform_Applications/Case_Study%3A_Tasky

Numerous tutorials available at Xamarin Dev Center– http://docs.xamarin.com/– http://forums.xamarin.com/

YouTube Xamarin Channel– http://www.youtube.com/user/xamarinhq

X86 Emulator install instructions– http://docs.xamarin.com/Android/Guides/Deployment,_Testing,_and_Metrics/Confi

guring_the_x86_Emulator

XAMARIN TOOLSP:26

Page 27: Tcdnug xamarin

MOBILE TOOLS SELECTIONConsiderations

Your mobile technology is a vital strategic selection

– Must consider immediate and future needs

– Assess skills needed to build and maintain

– Determine best fit for the application

CROSS PLATFORM MOBILE DEVELOPMENTP:27

Page 28: Tcdnug xamarin

CLOSING

Questions

Giveaways

CROSS PLATFORM MOBILE DEVELOPMENTP:28