There are a number of ways to get started to develop with 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 ArcGIS Maps SDK for Kotlin to access content, services, or an organization, you need an ArcGIS Location Platform 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:
2. Get the SDK and dependencies
To use the ArcGIS Maps SDK for Kotlin, install Android Studio, install the JDK used by Gradle, and get the ArcGIS Maps SDK for Kotlin and its dependencies.
Install an Android IDE with Gradle integrated.
The official IDE for Android app development is Android Studio, which can be installed as follows.
-
Check the Android Studio system requirements for your operating system, architecture, and version.
-
Download Android Studio.
You should install the latest stable version of Android Studio.
-
Run the installation file, following instructions in the Android Studio Setup wizard.
Install the JDK used by 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.
-
On the file system of your development machine, go to the
jbr
directory underneath the Android Studio installation. Open therelease
file and find the value of the JAVA_VERSION environment variable.That is the embedded JDK that Android Studio is using.
-
In Android Studio, select File > Settings (Windows) or Android Studio > Settings (macOS).
-
In the Settings dialog, click Build, Execution, Deployment > Build Tools > Gradle.
-
In the Gradle JDK field, select one of the JDKs from the drop-down menu. Make sure that the JDK you select has the same version as the embedded JDK.
Get the ArcGIS Maps SDK for Kotlin and dependencies
Follow all instructions on the Install and set up page. Note that you do not need to manually download the ArcGIS Maps SDK for Kotlin API. Once the Gradle files are properly configured, the Gradle build system will download the API and the versions of the dependencies you specify.
If you are developing ArcGIS Maps SDK for Kotlin applications in an environment that is disconnected from the internet, first obtain the API from the downloads page. Then follow the download's README, which provides instructions for the disconnected workflow.
3. Implement authentication
To access secure ArcGIS services and resources, you need to implement authentication. The easiest way to get started is to obtain an access token from an API Key and implement API key authentication. If you want to build an app that requires users to sign in with their ArcGIS account, implement user authentication.
API key authentication
- Build an app that doesn't require the user to sign in with an ArcGIS account.
- Create an API key to get a long-lived access token.
- Service usage is billed to the developer.
- Simplest authentication method to implement.
- Recommended approach for new ArcGIS developers.
- Available for ArcGIS Location Platform and ArcGIS Online developers only.
User authentication
- Build an app for your organization that requires users to sign in with an ArcGIS account.
- Create OAuth 2.0 credentials and implement OAuth 2.0 flows to get an access token.
- Service usage is billed to the organization of the user signed into the application.
- Authentication challenge handlers require more code to implement.
- Approach for ArcGIS Enterprise developers.
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.
@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 credentials
Learn how to implement user authentication to access a secure ArcGIS service with OAuth credentials.
6. Explore the samples
Go to the samples to learn how to perform more tasks with the API.

Display a map
Display a map with an imagery basemap.

Display a scene
Display a scene with a terrain surface and some imagery.

Show device location
Display your current position on the map, as well as switch between different types of auto pan modes.

Search with geocode
Find the location for an address.

Find route
Display directions for a route between two points.