30
Guy Barrette Code Monkey Azure MVP & MS Regional Directors Program @GuyBarrette http://guy.cloud Xamarin.Forms: a cross- platform mobile UI toolkit

Xamarin.Forms: a cross-platform mobile UI toolkit - ConFoo 2016

Embed Size (px)

Citation preview

Page 1: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Guy BarretteCode MonkeyAzure MVP & MS Regional Directors Program@GuyBarrettehttp://guy.cloud

Xamarin.Forms: a cross-platform mobile UI toolkit

Page 2: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin’s Approach

Page 3: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin’s Approach

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

iOS C# UI

Windows C# UIAndroid C# UI

Shared C# Mobile

Page 4: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin + 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 5: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Native Performance

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.

Page 6: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin Studio – Mac or PC

Page 7: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Visual Studio Integration

Page 8: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Hardware requirements

OR

Page 9: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Build native UIs for iOS, Android, and Windows Phone from a single, shared C# codebase.

Xamarin.Forms

Page 10: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016
Page 11: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

http://slingboards-lab.com/category/DayTickler

Page 12: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

http://slingboards-lab.com/category/DayTickler

Page 13: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

What’s included

✓ 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 14: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

<?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>

Native UI from shared code

Page 15: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Layouts

Pages

Stack Absolute Relative Grid ContentView

ScrollView

Frame

Content MasterDetail

Navigation

Tabbed Carousel

Page 16: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

ActivityIndicator BoxView Button DatePicker Editor

Entry Image Label ListView Map

OpenGLView Picker ProgressBar SearchBar Slider

Stepper TableView TimePicker WebView EntryCell

ImageCell SwitchCell TextCell ViewCell

Controls

Page 17: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin.Forms Ecosystem

Page 18: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Extensibility

Embed Custom Views Anywhere

Not only are Xamarin.Forms pages mixable with custom screens, you can embed custom views built directly against Xamarin.iOS and Xamarin.Android into Xamarin.Forms pages.

Call Platform APIs via Shared Services

Need platform-specific functionality within a Xamarin.Forms page, such as querying the accelerometer? We’ve included services that quickly and easily abstract platform-specific API calls to keep you writing as much shared code as possible.

Easy migration to the Xamarin Platform

When your native platform integration requirements outgrow Xamarin.Forms, your shared code is easily migrated to Xamarin.iOS and Xamarin.Android using the full Xamarin platform.

Page 19: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Let’s Take a Look

Page 20: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Pricing

Page 21: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016
Page 22: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Xamarin Classic or Xamarin.Forms?

Page 23: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

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 24: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Conclusion• Fantastic option to create cross-

platform mobile apps• Compile to native code• Awesome code reuse• Design the UI with code or

XAML• Easy to learn if you already use

the MS stack• C# is just like Java• Great IDE

• No designer• Pixel perfect UI

requires Xamarin Classic

• Frak! It’s expensive!!!

Page 25: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Thank You! Questions?

Page 26: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

More Xamarin goodness

Page 27: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

✓ Mac or PC✓ Runs side-by-side Windows Phone Emulator✓ Completely Free

xamarin.com/Android-Player

Xamarin Android Player

Page 28: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

xamarin.com/testcloud

Page 29: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

xamarin.com/insights

Page 30: Xamarin.Forms:  a cross-platform mobile UI toolkit - ConFoo 2016

Free 30 Day 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.