arcgis runtime sdk for .net: building xamarin apps · • write code using c#-share code across...

23
Rich Zwaap Thad Tilton Building Xamarin Apps ArcGIS Runtime SDK for .NET:

Upload: others

Post on 23-May-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Rich ZwaapThad Tilton

Building Xamarin AppsArcGIS Runtime SDK for .NET:

Page 2: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Agenda• Xamarin Overview

- What it is and why you would use it- Xamarin and ArcGIS Runtime

• Getting started

• Develop apps with Xamarin - Forms- Native

• Recommended patterns• Tips and tricks

Page 3: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Xamarin Overview

Page 4: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

What is it?

• Software suite for cross-platform .NET development• Libraries for iOS and Android

- Mono – open-source .NET implementation for non-Windows platforms- Platform bindings – surface iOS and Android APIs to C#- Xamarin Forms – cross-platform UI library

• Development tools - Integrated with Visual Studio- Windows or Mac

Page 5: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

What can you do with it?

• Build .NET apps for iOS, Android, Windows• Write code using C#

- Share code across platforms- Leverage platform-specific capabilities as needed

• Write UI markup with Xamarin Forms XAML- Share markup across iOS, Android, and UWP

• Write platform-specific (native) UI- AXML for Android- Storyboards for iOS- XAML for UWP

Page 6: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Why would I use it?

Code re-use (cross-platform)

Visual Studio and C#

Rapid development

All platform capabilities available

UI components render with native look and feel

Extensive developer community

Rapid updates

Page 7: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Two primary reasons developers use Xamarin

1. To use familiar language and tools: C# and Visual Studio2. To take advantage of code sharing for cross-platform development

Page 8: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

1. Xamarin Forms: a lot of shared code, less control• UI is defined with a Xamarin flavor of XAML• Subset of UI elements• Rendered as native controls for each platform• Basic cross-platform functionality

2. Xamarin Native: less shared code, more control• Each UI is created using platform-specific controls• *.axml (Android), *.storyboard (iOS), *.xaml (UWP)• User experience is true to the platform• More platform-specific control

Two approaches for Xamarin development …

More about this later …

<TimePicker x:Name="StartTimePicker"/>

Page 9: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Xamarin and ArcGIS Runtime

Page 10: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Xamarin in the ArcGIS Runtime SDK for .NET

• APIs for …- iOS- Android- Forms (supports iOS, Android, UWP)

• One common .NET API surface• High-performance 2D and 3D mapping• Take data and functionality offline• Utilize device sensors

Page 11: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Overview – ArcGIS RuntimeAn Architecture Designed to Maximize Performance and Reuse

C++ runtime core

WinLinux macOSAndroid iOS UWP

x86 x64 ARM ARM64DirectXOpenGLOpenGL ES

Page 12: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Overview – ArcGIS Runtime SDK for .NETAn Architecture Designed to Maximize Performance and Reuse

C++ runtime core

x86 x64 ARM ARM64DirectXOpenGLOpenGL ES

WPFUWPiOSAndroid

Xamarin.Forms

WinLinux macOSAndroid iOS UWP

Page 13: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Getting Started

Page 14: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Xamarin development optionsWindows or Mac

Mac OS X WindowsVisual Studio for Mac Visual Studio

Xamarin NativeiOS Requires Mac build host

AndroidmacOS *

Xamarin FormsiOS Requires Mac build host

AndroidUWP

* Not available for ArcGIS Runtime for .NET apps

Page 15: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Installing ArcGIS Runtime SDK for .NET

• Add NuGet packages from NuGet.org within Visual Studio- APIs: WPF, UWP, Xamarin.Android, Xamarin.iOS, Xamarin.Forms (Android, iOS, UWP)

- Toolkit• Visual Studio extension (VSIX)

- developers.arcgis.com/downloads- Project templates for each supported platform- Local NuGet package source for offline development- Not available for Visual Studio for macOS

Page 16: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Resources• ArcGIS for Developers - developers.arcgis.com- Downloads for all ArcGIS Runtime SDKs- Doc: Developers guide, API reference, Samples documentation

• Samples - github.com/esri/arcgis-runtime-samples-dotnet- Source code for all supported platforms- Xamarin projects: native and forms

• Toolkit - github.com/esri/arcgis-toolkit-dotnet- UI controls to provide additional functionality- Compass, Layer legend, Scale line, Symbol display

• Example apps - developers.arcgis.com/example-apps- Indoor Routing

Page 17: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

developers.arcgis.comDemo: Resources

Page 18: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Demo: Create a cross-platform Xamarin appRich Zwaap

Page 19: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

IDE Productivity- Use Visual Studio for Mac for iOS

Android HTTP performance and TLS 1.2 support- Use AndroidClientHandler

Toolkit components- Scaleline, Compass, Time Slider

Open Source Apps- Lots of app logic at your disposal

Forms embedding- Use Forms page in both iOS and Android

.NET Standard- Build cross-platform libraries

What did we see?Demo Summary

Page 20: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Other sessions of interest …

ArcGIS Runtime: Editing Your Data Online and OfflineWednesday 4:00 pm – 5:00 pm (Mesquite C)

ArcGIS Runtime: Building Cross-platform AppsThursday 9:00 am – 10:00 am (Mesquite B)

ArcGIS Runtime: Road AheadThursday 5:30 pm – 6:30 pm (Primrose B)

ArcGIS Runtime: Everything (or Anything) You Wanted to Know About the ArcGIS Runtime SDKs but Were Afraid to AskFriday 10:00 am – 11:00 am (Pasadena / Sierra / Ventura)

Page 21: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Share your getting started experiences!

• Visual Studio Magazine 2019 Reader's Choice Awards

• How can we make the SDK better for you?- Documentation and samples improvements?

• What was hard when you got started?- …and what was easy?

• What was great? (so we can do more of it)• What did you wish you knew when you first started?• What would have saved you a lot of time?

• Stop by the Runtime Island and share your feedback!

Page 22: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of

Complete answersand select “Submit”

Scroll down to find the feedback section

Select the session you attended

Download the Esri Events app and find your event

Please Take Our Survey on the App

Page 23: ArcGIS Runtime SDK for .NET: Building Xamarin Apps · • Write code using C#-Share code across platforms-Leverage platform-specific capabilities as needed ... To take advantage of