Get started

There are a number of ways to get started to develop with the ArcGIS Maps SDK for Kotlin. If you are new, follow the steps below to get started with Kotlin and Android Studio.

1. Sign up for an account

To use the ArcGIS Maps SDK for Kotlin to access content, services, or an organization, you need an ArcGIS Developer account, ArcGIS Online account, or ArcGIS Enterprise account. The type of account, user type, and role you need depends on the resource you need to access and the operations you wish to undertake.

If you do not have an account, select one of the options below:

Get started for free with ArcGIS Platform

Get a free trial for ArcGIS Online



2. Get the SDK and dependencies

To use the ArcGIS Maps SDK for Kotlin you need to:

Install an Android IDE with Gradle integrated.

The official IDE for Android app development is Android Studio, which can be installed as follows.

  1. Check the Android Studio system requirements for your operating system, architecture, and version.

  2. Download Android Studio.

    You should install the latest stable version of Android Studio.

  3. Run the installation file, following instructions in the Android Studio Setup wizard.

Install a JDK for Gradle

Installing Android Studio automatically installs an embedded version of the JDK, normally in a subdirectory named jbr. Gradle, however, uses its own JVM when starting the Gradle daemon. If these two versions of the JVM are not the same, Gradle may spawn extra deamons, which can slow down builds.

You should manually set the JDK that Gradle uses and make sure the embedded JDK and the Gradle JDK are the same version.

  1. On the file system of your development machine, go to the jbr directory underneath the Android Studio installation. Open the release file and find the value of the JAVA_VERSION environment variable.

  2. In Android Studio, access the Settings (Windows) or Preferences (macOS) dialog from the File menu.

  3. Click Build, Execution, Deployment > Build Tools > Gradle.

  4. In the Gradle JDK field, select a JDK that has the same version as the embedded JDK.

Get the ArcGIS Maps SDK for Kotlin and dependencies
  1. Expand the accordion below: Gradle build script. This is the module-level build script used in the Display a map tutorial.
  2. Copy the script into the module-level build.gradle.kts (normally, app/build.gradle.kts) file for your project.
  3. Reload the build script and build or run your project to download and unpack the API, its resources, and all dependencies.

For additional considerations, go to Install and set up.

3. Get an access token

To access secure ArcGIS services and resources, you need to use an access token. The easiest way to get started is to create an API key. Learn more about access tokens and authentication in Security and authentication.

Get an API key

Implement OAuth 2.0

4. Create your first mapping application

Follow the step-by-step instructions in the Display a map tutorial to create your first mapping application. The following code shows how you can create and display a map.

Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@Composable
fun MainScreen() {

    val map = remember {
        createMap()
    }

    Scaffold(
        topBar = { TopAppBar(title = { Text(text = stringResource(id = R.string.app_name)) }) }
    ) {

        MapView(
            modifier = Modifier.fillMaxSize().padding(it),
            arcGISMap = map
        )

    }

}

fun createMap(): ArcGISMap {

    return ArcGISMap(BasemapStyle.ArcGISTopographic).apply {

        initialViewpoint = Viewpoint(
            latitude = 34.0270,
            longitude = -118.8050,

            scale = 72000.0

        )

    }

}

Once you are done building your application, make sure to license it before deploying to production. For more information, see License and deployment topic for details.

5. Follow the tutorials

Go to the tutorials to create and run applications to perform different operations.

Display a web map

Display a preauthored map stored as an ArcGIS Online portal item.

Add a point, line, and polygon

Learn how to display a point, line, and polygon graphic in a map.

Access services with OAuth 2.0

Learn how to authenticate a user to access a secure ArcGIS service with OAuth 2.0.

6. Explore the samples

Go to the samples to learn how to perform more tasks with the API.

Authenticate with OAuth

Authenticate with ArcGIS Online (or ArcGIS Enterprise) using OAuth2 to access secured resources.

Add feature layers

Add feature layers from various data sources.

Find route

Display directions for a route between two points.

Next steps

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