argis runtime sdk for .net: building xamarin apps · 1. xamarin forms: a lot of shared code, less...

18
Nathan Castle | Thad Tilton Building Xamarin Apps ArcGIS Runtime SDK for .NET:

Upload: others

Post on 20-May-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Nathan Castle | Thad TiltonBuilding Xamarin AppsArcGIS Runtime SDK for .NET:

Page 2: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Agenda• Xamarin Overview

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

• Getting started- System requirements- Resources and tools

• Develop apps with Xamarin - Forms- Native

• Recommended patterns• Tips and tricks

Page 3: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

What it is and why you would use itXamarin Overview

“If you’re interested in mobile development and have .NET background, you’re basically already 80% there. All the architecture, libraries and so on—all of that will be available and familiar to you [in Xamarin].”

--James Montemagno, Principal Program Manager, Mobile Developer Tools (Microsoft)

Page 4: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

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: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

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: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

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: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

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 …

<TimePicker x:Name="StartTimePicker"/>

Page 8: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Requirements and resourcesGetting started

Page 9: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Xamarin with 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 10: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

ArcGIS Runtime SDK for .NET• NuGet packages from NuGet.org within Visual Studio

- APIs: WPF, UWP, Android, iOS, Forms (Android, iOS, UWP)- Toolkit

• Visual Studio extension (VSIX)- Visual Studio Extensions manager or

developers.arcgis.com/downloads- Project templates for each platform- Local NuGet packages- Not available for Visual Studio for

macOS

Page 11: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

ArcGIS Runtime SDK for .NET• Samples: https://github.com/Esri/arcgis-runtime-samples-dotnet• Toolkit (source): https://github.com/Esri/arcgis-toolkit-dotnet• Open source apps: https://developers.arcgis.com/example-apps/

• Documentation- Developers Guide, API reference, Samples

- https://developers.arcgis.com/net/- Tutorials

- https://developers.arcgis.com/labs/

• Community and support: https://developers.arcgis.com/net/support/

Page 12: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Xamarin IDE 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

More info at https://visualstudio.microsoft.com/vs/mac/#vs_mac_table

Page 13: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Code sharing options

• NET Standard library- Defines a set of .NET APIs that can be shared across multiple platforms- Available functionality depends on the .NET Standard version- Code is compiled into an assembly that can be easily shared

• Shared projects- Code is compiled into each referencing project- Can use compiler directives (#if) to add platform-specific logic

• Portable Class Library (deprecated)- Common API surface that uses interfaces for platform-specific logic

• .

Page 14: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

developers.arcgis.comDemo: Resources

Page 15: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Demo: Create a cross-platform Xamarin app

Page 16: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

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

.NET Standard- Build cross-platform libraries

What did we see?Demo Summary

Page 17: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements

Share your getting started experiences!

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

Page 18: ArGIS Runtime SDK for .NET: Building Xamarin Apps · 1. Xamarin Forms: a lot of shared code, less control • UI is defined with a Xamarin flavor of XAML • Subset of UI elements