Top Banner
Nick Landry Senior Technical Evangelist – Microsoft [email protected] Blog: AgeofMobility.com @ActiveNick | github.com/ActiveNick State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
80

State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Apr 16, 2017

Download

Technology

Nick Landry
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Nick LandrySenior Technical Evangelist – Microsoft

[email protected]

Blog: AgeofMobility.com

@ActiveNick | github.com/ActiveNick

State of Union:

Xamarin & Cross-Platform .NET

in 2016 and Beyond

Page 2: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Agenda

Page 3: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Silo Approach

iOS WindowsAndroid

Objective-C

Xcode

C#

Visual Studio

Java

Android Studio

No shared code • Many languages & development environments • Multiple teams

Page 4: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Write Once, Run Anywhere

App Generator

Lua

Javascript

Actionscript

HTML+CSS

Limited native API access • Slow performance • Poor user experience

Page 5: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin’s Unique Approach

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

iOS C# UI Windows C# UIAndroid C# UI

Shared C# Logic

Page 6: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

C# and Xamarin’s unique approachThe best of all worlds

Page 7: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

2016: A Great Year for Xamarin Developers!

Page 8: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin is included

in Visual Studio

Page 9: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 10: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

How Xamarin Works

Page 11: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Windows APIs

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 12: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

iOS – 100% API Coverage

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 13: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Android – 100% API Coverage

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 14: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

All 3 characteristics are required for a truly native app

Xamarin is native in all 3 ways

Native User Interface

Apps are built with standard, native

user interface controls for easy and

familiar interactions

Apps have access to the full spectrum of

functionality exposed by the underlying

platform and device

Apps leverage platform-specific hardware

acceleration, and are compiled as native

binaries, not interpreted at runtime.

High-fidelity API Access

Native Performance

Page 15: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

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 16: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Same-day support:• iOS 5• iOS 6• iOS 7• iOS 8• iOS 9

✓Always Up-to-DateFull support for:• Apple Watch• Apple TV• Android Wear• Amazon Fire TV• and much more

Page 17: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Visual Studio

Page 18: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin.com/Download

Visual Studio Integration

Page 19: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

New Light & Dark Themes in Xamarin Studio

Page 20: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin Studio - Sharable Components

Page 21: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Demo:

Tour of the Xamarin

Developer Experience

Page 22: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin exposes 100% of the native APIs

for iOS, Android and Windows

Page 23: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Anything you can do in Objective-C, Swift, or Java

can be done in C# with Xamarin using Visual Studio

Page 24: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Cross-Platform .NET:How did we get here?How can we make it better?

Page 25: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 26: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 27: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 28: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Browser Phone

Page 29: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 30: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 31: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 32: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 33: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 34: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 35: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Meet Xamarin.Forms

Page 36: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin + Xamarin.FormsWith Xamarin.Forms:

more code-sharing, native controls“Classic” Xamarin approach

Shared UI Code

Page 37: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

<?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 38: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin.Forms: Build Native User InterfacesUsing Shared Code

Shared App Logic in C#

Xamarin.Forms comes with over 40

common controls, pages and layouts to

make app UI creation fast and easy

Even basic animations are supported

Xamarin.Forms is Fully Extensible:

• Subclass included controls and

customize behavior

• Define and add your own controls,

layouts, pages and cells

• Expose your own platform-specific

controls in Xamarin.Forms pages

Page 39: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond
Page 40: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin.Forms is open source too!

Page 41: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

• Multi-Touch Enabled

• Pressure Sensitive

• Super Fast

• Rotate, screenshots,location changes

• Never leave Visual Studio

NEW! Visual Studio iOS Simulator Remoting

Page 42: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin.Forms XAML Previewer

Page 43: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Demo:

Sharing UI Code with

Xamarin.Forms

Page 44: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Use Decide Screen-by-Screen

Xamarin.Forms is great for forms-based

screens. You can mix Xamarin.Forms with

the full power of Xamarin.iOS and

Xamarin.Android in the same app for

complete control over your app’s look and

feel.

Xamarin.Forms: Mix-and-Match Screen-by-Screen, Element-by-Element

Call Platform APIs via Shared Services

Need platform-specifc 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.

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.

Page 45: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Roadmap

Page 46: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

XAML Compilation

Parsed and inflated

Parsed & turned into IL

Page 47: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

XAML Compilation Usage

[XamlCompilation(XamlCompilationOptions.Compile)]

[XamlCompilation(XamlCompilationOptions.Skip)]

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

Page 48: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

XAML Compilation Benefits

Page 49: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin.Forms Ecosystem

Page 50: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

https://evolve.xamarin.com/session/56e205b0bad314273ca4d817

https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976#.glqa5cmx6

Xamarin.Forms Performance

Page 51: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Sharing Code

Page 52: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Shared Projects

Page 53: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

1 Assembly

Multiple Platforms

Including:

Xamarin.iOS and Xamarin.Android

Portable Class Libraries

Page 54: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

NuGet

Page 55: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Choosing a Code Sharing Option

Page 56: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Demo:

Sharing Code with PCLs

Page 57: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Sharing Code Beyond

PCLs and .NET Standard:Lighting-up Platform-Specific Code

Page 58: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Complementing .NET

Page 59: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

PlatformSpecific Code

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

What if we could access it from shared code?

UI+APIs UI + APIsUI + APIs

Battery

GPS

Lights

Notifications

Settings

Text To Speech

Battery

GPS

Lights

Notifications

Settings

Text To Speech

Battery

GPS

Lights

Notifications

Settings

Text To Speech

Page 60: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin Components and Plugins

https://github.com/xamarin/XamarinComponents

https://components.xamarin.com

Page 61: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

TextToSpeech

Speak(“Hello World”);

AVSpeechSynthesizer SpeechSynthesizer

Page 62: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Plugins for Xamarin

Common API

Page 63: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Sharing Code Beyond PCLs & .NET Standard

Page 64: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Sharing Code Beyond PCLs & .NET Standard

Page 65: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Demo:

Plugins for Xamarin &

Windows

Page 66: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

More New Stuff

Page 67: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Skia Sharp - 2D Graphics Library

Page 68: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin Workbooks – Interactive C#

Page 69: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin Profiler

Page 70: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Xamarin Profiler – Cycle Detection

Page 71: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Fall Themes

Page 72: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Watch dotNetConf 2016for more on Xamarin, .NET, .Net Core, ASP.NET, Open Source, the Future, etc.

http://www.dotnetconf.net/

Page 73: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Summary

Page 74: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

github.com/ActiveNick/MyWeather

github.com/ActiveNick/MyWeatherNUI

github.com/jamesmontemagno/MyWeather.Forms

github.com/xamarin/xamarin-forms-samples

github.com/xamarin/mini-hacks

github.com/xamarin

https://github.com/jamesmontemagno

http://motzcod.es

Session Demos & Xamarin Videos

Page 75: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

https://aka.ms/xamebook

https://aka.ms/xamebook/epub

https://aka.ms/xamebook/mobi

Free Xamarin.Forms eBook

Page 76: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

https://blog.xamarin.com/performing-ocr-for-ios-android-and-windows-with-microsoft-cognitive-services/

https://github.com/pierceboggan/smarter-apps/tree/master/ExpenseIt/

https://blog.xamarin.com/adding-facial-recognition-to-your-mobile-apps/

https://github.com/pierceboggan/smarter-apps/tree/master/talk/employee-directory/

https://github.com/xamarin/mini-hacks/tree/master/microsoft-cognitive-services/solutions

Demo: Xamarin + Cognitive Services

Page 77: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

https://github.com/DotNetToscana/See4Me

https://github.com/ActiveNick/BingTranslateDemo

Demo: Xamarin + Cognitive Services

Page 78: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

http://xamarin.com/download

http://docs.xamarin.com

http://evolve.Xamarin.com

http://xamarin.com/university

http://blog.xamarin.com

http://motzcod.es

http://weblogs.asp.net/wallym

http://www.gregshackles.com

Xamarin Resources

Page 79: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Online Microsoft training delivered by experts to help technologists continually learn

Hundreds of courses for developers, IT Pros, students, entrepreneurs and enthusiasts

11 different languages

More than 2.1M students registered

Build your own Learning Plan

All free!

Cross-Platform Development withXamarin & Visual Studio

aka.ms/MVAxamarin

http://www.microsoftvirtualacademy.com

Page 80: State of Union: Xamarin & Cross-Platform .NET in 2016 and Beyond

Thank You!

Slides are posted SlideShare. Demos are on GitHub.

Slideshare: www.slideshare.net/ActiveNick

Blog: www.AgeofMobility.com

Twitter: @ActiveNick

Mobile Apps: www.bigbaldapps.com

LinkedIn: www.linkedin.com/in/activenick

GitHub: github.com/ActiveNick

Email: [email protected]