introduction to xamarin.forms

38

Upload: james-montemagno

Post on 30-Jul-2015

94 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Xamarin.Forms
Page 2: Introduction to Xamarin.Forms

JamesMontemagnoDeveloper Evangelist, Xamarin

[email protected] motzcod.es @JamesMontemagno

Page 3: Introduction to Xamarin.Forms

DESIGN – DEVELOP -‐ INTEGRATE TEST MONITOR

LEARN

Page 4: Introduction to Xamarin.Forms

Shared C# codebase • 100% native API access • High performance

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Mobile

Page 5: Introduction to Xamarin.Forms

Microsoft.Phone Microsoft.Networking Windows.Storage Windows.Foundation Microsoft.Devices

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 6: Introduction to Xamarin.Forms

MapKit UIKit iBeacon CoreGraphics CoreMotion

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 7: Introduction to Xamarin.Forms

Text-to-speech ActionBar Printing Framework Renderscript NFC

System.Data System.Windows System.Numerics System.Core System.ServiceModel

System.Net System System.IO System.Linq System.Xml

Page 8: Introduction to Xamarin.Forms

Xamarin.iOS does full Ahead Of Time (AOT) compilation to produce an ARM binary for Apple’s App Store.

Xamarin.Android takes advantage of Just In Time (JIT) compilation on the Android device.

.NET

C# Compileand Link .APK

Bindings

RunsNatively

IL+

JIT

Page 9: Introduction to Xamarin.Forms
Page 10: Introduction to Xamarin.Forms

✓Always Up-to-Date•••••

•••••

Page 11: Introduction to Xamarin.Forms
Page 12: Introduction to Xamarin.Forms
Page 13: Introduction to Xamarin.Forms

Xamarin.iOS Xamarin.Android

Page 14: Introduction to Xamarin.Forms
Page 15: Introduction to Xamarin.Forms
Page 16: Introduction to Xamarin.Forms

Mac

iOS

Android

Windows Phone

Calca iCircuit Touch Draw

86%

14%

72%

28%

77%

23%

70%30%

61%39%

94%

6%

88%

12%

76%

24%

90%

10%

Page 17: Introduction to Xamarin.Forms
Page 18: Introduction to Xamarin.Forms

Traditional Xamarin Approach

With Xamarin.Forms:More code-sharing, all native

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Backend

Shared UI Code

Shared C# Backend

Page 19: Introduction to Xamarin.Forms

✓ 40+ Pages, layouts, and controls(Build from code behind or XAML)

✓ Two-way data binding✓ Navigation✓ Animation API✓ Dependency Service✓ Messaging Center

Shared C# Backend

Shared UI Code

Page 20: Introduction to Xamarin.Forms

Which Xamarin approach is best for your app?

Xamarin.Forms is best for: Xamarin.iOS / Xamarin.Android is best for:

• Data entry apps

• Prototypes and proofs-of-concept

• Apps that require little platform-specific functionality

• Apps where code sharing is more important than custom UI

Learn more: xamarin.com/forms Learn more: xamarin.com/platform

• Apps that require specialized interaction

• Apps with highly polished design

• Apps that use many platform-specific APIs

• Apps where custom UI is more important than code sharing

Page 21: Introduction to Xamarin.Forms

<?xml version="1.0"  encoding="UTF-­‐8"?><TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"x:Class="MyApp.MainPage">

<TabbedPage.Children><ContentPage Title="Profile"  Icon="Profile.png">

<StackLayout Spacing="20" Padding="20"VerticalOptions="Center">

<Entry Placeholder="Username"Text="{Binding  Username}"/>

<Entry Placeholder="Password"Text="{Binding  Password}"IsPassword="true"/>

<Button Text="Login"  TextColor="White"BackgroundColor="#77D065"Command="{Binding  LoginCommand}"/>

</StackLayout></ContentPage><ContentPage Title="Settings"  Icon="Settings.png">

<!-­‐-­‐ Settings -­‐-­‐></ContentPage></TabbedPage.Children>

Page 22: Introduction to Xamarin.Forms

Xamarin.FormsButton

ClickedText

Android Button

ClickedText

iOSUIButton

TouchUpInsideText

WindowsButton

ClickedContent

Page 23: Introduction to Xamarin.Forms

Layouts

Pages

Stack Absolute Relative Grid ContentView ScrollView Frame

Content MasterDetail Navigation Tabbed Carousel

Page 24: Introduction to Xamarin.Forms

ActivityIndicator BoxView Button DatePicker Editor

Entry Image Label ListView Map

OpenGLView Picker ProgressBar SearchBar Slider

Stepper TableView TimePicker WebView EntryCell

ImageCell SwitchCell TextCell ViewCell

Page 25: Introduction to Xamarin.Forms

Xamarin.Forms Ecosystem

Page 26: Introduction to Xamarin.Forms

Windows Xamarin.FormsStackPanel StackLayout

TextBox Entry

ListBox ListView

CheckBox Switch

ProgressBar ActivityIndicator

Grid Grid

Label Label

Button Button

Image Image

Date/TimePicker Date/TimePicker

Page 27: Introduction to Xamarin.Forms

Windows Xamarin.Forms

DataContext BindingContext

{Binding Property} {Binding Property}

ItemsSource ItemsSource

ItemTemplate ItemTemplate

DataTemplate DataTemplate

Page 28: Introduction to Xamarin.Forms
Page 29: Introduction to Xamarin.Forms
Page 30: Introduction to Xamarin.Forms
Page 31: Introduction to Xamarin.Forms

Shared C# Backend

Page 32: Introduction to Xamarin.Forms

What if we didn’t have to write this code?

What if we could access it from shared code?

UI+APIs UI + APIsUI + APIs

BatteryGPSLightsNotificationsSettingsText To Speech

BatteryGPSLightsNotificationsSettingsText To Speech

BatteryGPSLightsNotificationsSettingsText To Speech

Page 33: Introduction to Xamarin.Forms

TextToSpeech

Speak(“Hello World”);

AVSpeechSynthesizer SpeechSynthesizer

Page 34: Introduction to Xamarin.Forms

Common API

Page 35: Introduction to Xamarin.Forms
Page 36: Introduction to Xamarin.Forms

Get Started Todayxamarin.com

Page 37: Introduction to Xamarin.Forms

Free trial - xamarin.com/university

Unrivaled Mobile Development

Training

Live unlimited mobile development training from mobile experts, in your time-zone, on your schedule, and as often as you'd like.

Page 38: Introduction to Xamarin.Forms

Thank you.

JamesMontemagnoDeveloper Evangelist, Xamarin

[email protected] motzcod.es @JamesMontemagno

Questions?