25
ArcGIS Runtime SDK for Android: Building Apps Shelly Gill

ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

  • Upload
    others

  • View
    13

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

ArcGIS Runtime SDK for Android:Building AppsShelly Gill

Page 2: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Agenda

• Getting started

• SDK

• Common patterns and Example Apps

• Android platform updates

• Kotlin

• Team goals for upcoming releases

• Other sessions - ArcGIS Runtime: An Introduction; Editing Online and Offline, Building 3D Applications, Working with Maps Online and Offline

Page 3: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Getting started with ArcGIS Runtime SDK for Android apps

• Sign up for free Developers testing account- 50 credits a month, premium content, register apps, test tokens

• Install free Android Studio IDE- http://developer.android.com/sdk

• Get dependencies automatically with Gradle and try it out- Write an app!

Page 4: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

New developers - Follow first map app tutorial

• Developers site > Android > Guide- http://developers.arcgis.com/android/latest/guide- Help topics

• Getting started > Develop your first map app

• Step-by-step guide

• Or try Dev Labs - 8 so far – layers, maps, scenes, features, graphics, geocoding, routing, OAuth- https://developers.arcgis.com/labs/?product=Android

Page 5: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Existing developers - clone samples or example apps

• Clone, import, and run

• API samples- GitHub- http://github.com/Esri/arcgis-runtime-samples-android- Java and Kotlin

• Example apps

Page 6: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Existing apps - add AAR dependency

• Availble from maven repository hosted by Bintray- AARs of current and previous releases

• Add Esri Bintray repo to your project gradlerepositories {

maven {

url 'https://esri.bintray.com/arcgis'

}

• Add runtime dependency to your app module gradledependencies {

implementation 'com.esri.arcgisruntime:arcgis-android:100.4.0'

Page 7: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

SDK resources

• Developers site- http://developers.arcgis.com/android- Doc – guide, API Reference- Downloadable SDK - Application support

• GitHub for samples and example apps

• GeoNet user communities- https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-android

Page 8: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Sample Viewer

• Run samples + view code• From 100.3.0 release• Google Play Store

• Search "Esri Runtime"

• Or from ArcGIS Online• Search "Runtime SDK Sample"

Page 9: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Getting started in Android Studio

Hello world / display-map

https://developers.arcgis.com/android/latest/guide/develop-your-first-map-app.htm

Page 10: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Example apps

• Based on use cases collected from users

• Complete workflow apps, real-world architectures

• Supporting documentation- Key code, data creation, app workflows, customization

• Open sourced on GitHub (Apache 2.0 license)

• Various Runtime versions

Page 11: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Example apps: Maps app

• Authentication with ArcGIS Online- Cross platform pattern of authentication challenges and challenge handlers- Out-of-the-box UI and UX

• Portal- List organizations basemaps, using Portal, PortalQueryParameters, PortalInfo.getBasemapGalleryGroupQuery()

• MapView/ArcGISMap

• Geocoding- LocatorTask geocodeAsync, reverseGeocodeAsync, suggestAsync

• Routing- RouteTask solveRouteAsync

Page 12: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Default challenge handler with OAuthManager

AuthenticationManager.setAuthenticationChallengeHandler(new DefaultAuthenticationChallengeHandler(context));

OAuthConfiguration config = new OAuthConfiguration(<Portal URL>, <Client ID>, <Redirect URI>);

AuthenticationManager.addOAuthConfiguration(config);

Page 13: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Example apps: Nearby Places

• Device location- workflow when map is not yet created

• MapView/ArcGISMap

• Geocoding- Using GeocodeParameters.getCategories().add(...)

• NavigationChangedListener to refresh contextual info based on map extent

Page 14: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Example apps: Ecological Marine Unit

• MapView/ArcGISMap

• MobileMapPackage (.mmpk)

• Feature layers- Querying- Filtering - definition expression- Presents attribute information

Page 15: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Example apps: Offline Map Book

• MapView/ArcGISMap

• MobileMapPackage (.mmpk)

• Identify, Callout, PopUp

• Authentication with ArcGIS Online- OAuth stores access and refresh tokens to CredentialCache- Cache encrypted with AES and stored on device

• Geocoding with LocatorTask- Custom offline locators on water network features with

suggestions

Page 16: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

• Official language for over a year- Interoperable with Java, Java standard types- Modern language features – nullable types, function types, auto-casting, ...- Open source, by JetBrains - http://kotlinlang.org/docs/reference/

• "27% of the top 1000 Android apps on Google Play already use Kotlin"- Esri apps like Collector, Navigator etc

• Support in Runtime SDK- Migrating samples- Future plans for documentation

Kotlin

Page 17: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Kotlin and the Runtime API

• Simple but effective- auto casting for hierarchies like geometries, layers, symbols, renderers

• Kotlin adds synthetic property accessors - For getters/setters that follow naming patterns- Does not include 'can', 'has' getters that Runtime API sometimes uses

• Kotlin has explicit nullable types, and null-checks at compile time- Kotlin can't get nullability info from existing libraries – like Runtime API- Kotlin treats these objects as 'platform-types' – may give NPE- Android 9 Pie (API 28) starting to add nullability annotation in Android Framework- Nullability annotations as future team goal

Page 18: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Kotlin with Runtime APIsynthetic properties, auto-casting, limitations

Demo

Page 19: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Android Platform

• 100.3.0 release moved minimum Android SDK version support to KitKat – API 19 (4.4)defaultConfig {

minSdkVersion 19}

• Possibility of near future increase to support TLS 1.2

• Can increase minSDK if required to get more functionality (language features, multi-window etc)

Android platforms: connections toGoogle Play store 28th Sep 2018

26+ Oreo andnewer24-25: Nougat

23:Marshmallow21-22: Lollipop

19-20: KitKat

10-18: JellyBean and older

Page 20: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Play Store requirements

• Currently Runtime has armeabi-v7a and x86 native libraries- Currently all 64-bit devices maintain 32-bit compatibility- "adb shell getprop" to find out what your device supports

• Google introduces 64-bit support for apps with native libraries by August 2019- In anticipation of future devices- Affects new apps and app updates

• Runtime future release to include arm64-v8a, x86_64 native libraries- Working on updating our build processes, moving to NDK18

• Internally team aim to update more quickly to targetSdkVersion of latest release- Following Googles recent advice and new store rules to target a release < 1 yr old

Page 21: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Other team goals

• Cross-runtime functionality support

• Toolkit- Feedback on importance of different tools

• API reference- "since" information

• Kotlin support improvements- Samples - Java currently 113, Kotlin 11, 14 more on the way- Possibility of adding Kotlin code snippets in the Guide- Possibility of adding nullability annotations in future

Page 22: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Virtual and augmented reality with ArcGIS Runtime

• Enhance existing ArcGIS Runtime SDKs- VR: Add “stereo display” rendering mode- AR: Transparent background to render on

video/camera feed- Integration with game engines like Unity

and Unreal

• Private beta program via Esri Early Adoptercommunity

- .NET, iOS and Android SDKs- Targeting high-end mobile devices with best

chipsets, high resolution, good AR/VR kits- To request access to the beta program, email:

[email protected]

Page 23: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Please Take Our Survey on the App

Download the Esri Events app and find your event

Select the session you attended

Scroll down to find the feedback section

Complete answersand select “Submit”

Page 24: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Questions?

developers.arcgis.com/arcgis-runtimedevelopers.arcgis.com/android

Page 25: ArcGIS Runtime SDK for Android: Building Apps€¦ · New developers - Follow first map ... (language features, multi-window etc) Android platforms: connections to Google Play store

Thank You to Our Sponsors