Get started

Get started with the ArcGIS Runtime API for Android:

  1. Review system requirements
  2. Install and set up
  3. Get an API key (to access services)
  4. Complete the Display a map tutorial

1. System requirements

Ensure your development environment meets the system requirements.

For an overview of this release, including enhancements, deprecations, and known issues, see the Release notes.

2. Install and set up

We recommend installing with Gradle, which will install the needed dependencies and SDK binaries from Esri's Maven repository. If you are unable to make use of Gradle, you can instead download the SDK and then add dependencies to your project manually by including the AAR library and dependency artifacts.

Get the API with Gradle

Perform the following set up steps in an existing Android Studio project, or create a new project.

  1. In your settings.gradle file, within the repositories block of the dependencyResolutionManagement block, add a maven block and specify the URL of Esri's Maven repository. Esri's repository is not open source and therefore not available from google() or mavenCentral(), so you must specify this URL.

    settings.gradle
    Use dark colors for code blocks
              
    Add line.Add line.Add line.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
            maven {
                url 'https://esri.jfrog.io/artifactory/arcgis'
            }
        }
    }
  2. In your module-level build.gradle file, within the dependencies block, add the ArcGIS Runtime SDK for Android dependency to your app.

    build.gradle
    Use dark colors for code blocks
        
    Add line.
    1
    2
    3
    4
    dependencies {
        . . .
        implementation 'com.esri.arcgisruntime:arcgis-android:100.15.0'
    }
  3. In your module-level build.gradle file, within the android block, make sure you have the following directive to set compatibility with Java 8 language features:

    build.gradle
    Use dark colors for code blocksCopy
            
    1
    2
    3
    4
    5
    6
    7
    8
    android {
      . . .
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
      . . .
    }
  4. In your module-level build.gradle file, within the android block, make sure you have a buildFeatures block that enables view binding. For more information on view binding, see https://developer.android.com/topic/libraries/view-binding.

    build.gradle
    Use dark colors for code blocksCopy
           
    1
    2
    3
    4
    5
    6
    7
    android {
        . . .
        buildFeatures {
            viewBinding true
        }
        . . .
    }
  5. In your module-level build.gradle file, within the android block, make sure you have a packagingOptions block that excludes duplicates of the META-INF\DEPENDENCIES file. This setting will prevent a compiler error that occurs if you try to include the same file in the META-INF directory more than once in the output. For more information on packaging options, see https://developer.android.com/reference/tools/gradle-api/7.4/com/android/build/api/dsl/PackagingOptions.

    build.gradle
    Use dark colors for code blocksCopy
           
    1
    2
    3
    4
    5
    6
    7
    android {
        . . .
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
        }
        . . .
    }

Get the API manually

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

Download Android SDK
  1. Sign in to ArcGIS Developer.
  2. On your Dashboard, click Downloads, and select the latest version of ArcGIS Runtime SDK for Android.
  3. Unzip the downloaded archive to a location on your development machine.

Manually add dependencies to the ArcGIS Runtime SDK for Android or use other resources contained in the download. The Android library module (.aar), found in the libs folder, contains the API jar libraries arcgis-android-api and its third-party dependencies and core native libraries.

Setting up ArcGIS Android API to work with local Maven repository

The following setup steps assume that you are working in a development environment that is disconnected from the internet. For example, behind a firewall that doesn't allow access to Maven repositories that are hosted on the internet. If you are developing with internet access, please follow Get the API with Gradle instead.

The following steps describe the setup with a Maven repository that is on your local machine; however, they can be applied in a similar way if you have a Maven server set up on your network.

Deploy SDK and its dependencies to your computer
  1. Obtain the arcgis-runtime-sdk-android-100.15.0.zip file in whatever way is compatible with the security measures at your work environment.

  2. Extract the contents of the archive to a location on disk.

  3. From the extracted location, copy the contents of the libs/aar directory to the following location on your disk. (Note that your local Maven repo is the directory tree rooted at .m2\repository in your user directory.)

    mac: /Users/[user-name]/.m2/repository/com/esri/arcgisruntime/arcgis-android/100.15.0/

    Windows: %USERPROFILE%\.m2\repository\com\esri\arcgisruntime\arcgis-android\100.15.0\

  4. Your full directory path should resemble the following:

    mac (2 files):

    /Users/[user-name]/.m2/repository/com/esri/arcgisruntime/arcgis-android/100.15.0/arcgis-android-100.15.0.aar

    /Users/[user-name]/.m2/repository/com/esri/arcgisruntime/arcgis-android/100.15.0/arcgis-android-100.15.0.pom

    Windows (2 files):

    %USERPROFILE%\.m2\repository\com\esri\arcgisruntime\arcgis-android\100.15.0\arcgis-android-100.15.0.aar

    %USERPROFILE%\.m2\repository\com\esri\arcgisruntime\arcgis-android\100.15.0\arcgis-android-100.15.0.pom

  5. A list of these dependencies and the URLs from where they may be downloaded is below. You should obtain them in whatever way is compatible with the security measures at your work environment.

  6. Deploy the dependencies you downloaded in the previous step. You use Maven to install the dependencies in your local Maven repo.

    • Install the mvn Maven tool.

      mac:

      brew install mvn

      Windows:

      See https://maven.apache.org/guides/getting-started/windows-prerequisites.html for information about installing the mvn Maven tool.

    • For androidx dependencies (browser and localbroadcastmanager), run:

      mvn install:install-file -Dfile=<relative path to aar> -DgroupId=<group ID> -DartifactId=<artifact id> -Dversion=<version> -Dpackaging=aar -DgeneratePom=true

    • For all other dependencies, run:

      mvn install:install-file -Dfile=<relative path to aar> -DgroupId=<group ID> -DartifactId=<artifact id> -Dversion=<version> -Dpackaging=jar -DgeneratePom=true

  7. Your local Maven repo should be set. We will modify the build files to use your local Maven repo in the next section.

Edit Gradle build settings and scripts
  1. You should edit your project gradle.settings file to look at your local Maven repository. To do this, add mavenLocal() as follows:

    gradle.settings
    Use dark colors for code blocks
            
    Add line.
    1
    2
    3
    4
    5
    6
    7
    8
    dependencyResolutionManagement {
        repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
        repositories {
            google()
            mavenCentral()
            mavenLocal()
        }
    }
  2. In your module-level build.gradle file, add the following dependencies:

    build.gradle
    Use dark colors for code blocks
                   
    Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.Add line.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    dependencies {
            . . .
        implementation 'com.esri.arcgisruntime:arcgis-android:100.15.0'
        implementation 'com.google.code.gson:gson:2.9.0'
        implementation 'androidx.browser:browser:1.4.0'
        implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0'
        implementation 'org.apache.httpcomponents.core5:httpcore5:5.0.4'
        implementation 'org.apache.httpcomponents.core5:httpcore5-h2:5.0.4'
        implementation 'org.slf4j:slf4j-api:1.7.32'
        implementation 'commons-codec:commons-codec:1.15'
        implementation 'org.conscrypt:conscrypt-openjdk-uber:2.2.1'
        implementation 'net.spy:spymemcached:2.12.3'
        implementation 'org.ehcache.modules:ehcache-api:3.4.0'
    
    }
  3. In your module-level build.gradle file, within the android block, make sure you have the following directive to set compatibility with Java 8 language features:

    build.gradle
    Use dark colors for code blocksCopy
            
    1
    2
    3
    4
    5
    6
    7
    8
    android {
        . . .
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        . . .
    }
  4. In your module-level build.gradle file, within the android block, make sure you have a buildFeatures block that enables view binding. For more information on view binding, see https://developer.android.com/topic/libraries/view-binding.

    build.gradle
    Use dark colors for code blocksCopy
           
    1
    2
    3
    4
    5
    6
    7
    android {
        . . .
        buildFeatures {
            viewBinding true
        }
        . . .
    }
  5. In your module-level build.gradle file, within the android block, make sure you have a packagingOptions block that excludes duplicates of the META-INF. This setting will prevent a compiler error that occurs if you try to include the same file in the META-INF directory more than once in the output. For more information on packaging options, see https://developer.android.com/reference/tools/gradle-api/7.4/com/android/build/api/dsl/PackagingOptions.

    build.gradle
    Use dark colors for code blocksCopy
           
    1
    2
    3
    4
    5
    6
    7
    android {
        . . .
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
        }
        . . .
    }

3. Access services and content with an API key

API keys are permanent tokens that grant your application access to ready-to-use services and, with an ArcGIS Developer account, private content hosted in ArcGIS (currently in beta). Your apps will always require an access token, such as an API key or OAuth 2.0 token, in order to access these resources. Refer to authentication methods in the developer guide for details.

To set an API key in your application, find and copy an API key from your developer dashboard and replace the string YOUR_API_KEY / ACCESS_TOKEN in your code with the API key copied from your dashboard. This key is scoped to provide access to all of the services and resources shown in the tutorials.

  1. Log in to your developer dashboard.
  2. Select and copy your default API key, or generate a new one.
  3. In your code, replace the string YOUR_API_KEY / ACCESS_TOKEN with the API key from your dashboard.

4. Tutorials

Follow step-by-step instructions to build apps that incorporate ArcGIS Runtime functionality.

Display a map

Add a point, line, and polygon

Display a scene

Add a feature layer

Browse all tutorials

Deploy your app

No license is required to develop ArcGIS Runtime apps; there is no need to authorize your development machine or devices. As a member of the ArcGIS Developer Program, you have a free ArcGIS Developer Account (Essentials Plan). With this plan, you can download and install any ArcGIS API 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.

You need an ArcGIS Developer Subscription to deploy an app to your users. The Essentials plan is free.

Learn more about Runtime licensing and deployment and get your license string at License and deployment.

Next steps

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.