ArcGIS Runtime SDK for Android

Install the SDK

Start here to set up your development environment with ArcGIS Runtime SDK for Android. You can have multiple versions of this SDK on the same machine. You can also have ArcGIS Runtime SDK for Android on the same machine as other ArcGIS Runtime SDKs.

Check your machine and Android devices meet the System requirements for this SDK. The information below assumes you are using the latest version of Android Studio.

Note:

No license is required to develop ArcGIS Runtime apps; there's no need to authorize your development machine. As a member of the ArcGIS Developer Program, you have a free ArcGIS Developer Subscription (Essentials Plan). With this plan you can download and install any ArcGIS Runtime SDK and immediately have access to all the functionality of the APIs for development purposes. You can become a member of the developer program for free.

Gradle

We recommend installing with Gradle, which will install the needed dependencies and the SDK binaries from a Bintray Esri repository. For a more detailed walkthrough of these steps, see Develop your first map app. For more information on Gradle, see https://gradle.org.

  1. In your project-level build.gradle file, within the repositories block, add Esri's maven repository URL to your project. Esri's repository is not open source and therefore not available in the default repository in the script, so you must specify this URL.

    allprojects {
      repositories {
        google()
        jcenter()
        
        // Add the Esri public Bintray Maven repository
        maven {
            url 'https://esri.bintray.com/arcgis'
        }
      }
    }

  2. In your module-level build.gradle file, within the dependencies block, add the ArcGIS Runtime SDK for Android dependency to your app.

    dependencies { 
      implementation 'com.esri.arcgisruntime:arcgis-android:100.3.0' 
      [...]
    }

    Note:

    You must add the dependency to each module you wish to use ArcGIS Runtime SDK for Android in.

  3. Depending on what ArcGIS functionality you use in your app, it is likely you will also need to add permissions to your manifest, as described in the following section.
  4. Android Studio supports a subset of Java 8 language features, and these features are used throughout the ArcGIS Runtime SDK for Android documentation and samples. To ensure code examples compile if used in your apps, set the compatibility of your app module to use Java 8.

    In the app module build.gradle file, within the android block, add the following directive to set the Java compatibility version.

    android {
      [...]
      // Add below lines to set compatibility with Java 8 language features for an Android app module.
      compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
      }
    }
  5. Additionally, you may need to follow these steps, depending on the Runtime functionality used in your app:

You're ready to start programming with the ArcGIS Runtime SDK for Android! From here you may want to try developing your first map app, or dive right in to samples or the API Reference.

A minimum Android API version is required on any target device you will run your app on. For more information, see the System requirements.

Required permissions and features

Android is a permissions-separated operating system. Depending on what ArcGIS capabilities you use in your app, you may need to add permissions to your manifest, as follows. Be sure not to include permissions for capabilities not included in your app.

If an app is running on Android API level 22 or below, all permissions are requested, and granted or denied, at install time. If an app is running on Android API level 23 or above, normal permissions are requested and automatically granted at install time; however, dangerous permissions must be requested at run time—you will need to add code to your app to do this. The Android framework or Android Support library can be used to check for permissions, and request permissions if not already granted. For more information, see Declaring Permissions and Requesting Permissions at Run Time.

ArcGIS Runtime SDK for Android capabilities that require permissions:

  • Access to the Internet (most apps will require this) - normal permission in Android API 23 and above
  • Access to files on local storage (some apps will require this) - dangerous permission in Android API 23 and above
  • Access to the device's GPS will require fine location permissions - dangerous permission in Android API 23 and above

The following code example (for the AndroidManifest.xml file) includes all permissions.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Additionally, adding a uses-feature element to the Android manifest will help the Play store make your app available to the correct type of devices.

  • Apps that use a GeoView will require using OpenGL 2.x:

    <uses-feature android:glEsVersion="0x00020000" android:required="true" />

  • Apps that use Viewshed or LineOfSight will require using OpenGL 3.x:

    <uses-feature android:glEsVersion="0x00030000" android:required="true" />

SDK download

If you are unable to make use of the public Gradle repository described previously, you can alternatively download the SDK. You can then add dependencies to your project manually by including the local AAR and all dependency artifacts. You can also download a separate PDF of the Guide documentation.

Download, install, and set up the local SDK

  1. Sign in to ArcGIS for Developers.
  2. In the Dashboard tab and click Download APIs and SDKs.
  3. Download the ArcGIS Runtime SDK for Android to your machine.
  4. Unzip the downloaded archive to a location on your development machine.

Now you can manually add dependencies to the ArcGIS Runtime SDK for Android or use other resources contained in the download.

You can also download, from the the downloads page on developers.arcgis.com (requires you to log in):

  • Previously released versions of the SDKs
  • Projection Engine data files for grid-based transformations
  • A PDF version of the guide documentation

Contents of the SDK download

The download contains everything you need to develop ArcGIS Runtime SDK for Android apps.

  • doc: API reference documentation
  • legal: Licensing documentation
  • libs: An Android library module (.aar), containing API jar libraries arcgis-android-api and it's third-party dependencies, and core native libraries


In this topic
  1. Gradle
  2. SDK download