argis runtime sdk for .net: building xamarin apps · 1. xamarin forms: a lot of shared code, less...
TRANSCRIPT
Nathan Castle | Thad TiltonBuilding Xamarin AppsArcGIS Runtime SDK for .NET:
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
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)
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
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
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
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"/>
Requirements and resourcesGetting started
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
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
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/
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
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
• .
developers.arcgis.comDemo: Resources
Demo: Create a cross-platform Xamarin app
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
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?