Project Setup
This guide describes how you can set up your Android project to use the TomTom Maps and Navigation SDK. After completing the guide you should have an empty Android project that works using Navigation SDK dependencies.
Requirements and recommended tools
Before proceeding with the project setup, ensure that your project meets the following requirements:
- Android ABIs: arm64-v8a and x86_64.
- Android API Level:
- Min SDK Version: 26 (Android 8.0 “Oreo”) or above.
- Compile SDK Version: 35 (Android 15) or above.
- NDK: version 26; other major versions may not be compatible.
- Java: version 8 or later for
sourceCompatibilityandtargetCompatibility. - Kotlin: version 1.8.0 or later.
- OpenGL ES: 3.0 support.
For an optimal developer experience, we recommend using the following tool versions as used in our sample projects and code snippets:
- Android Studio Narwhal Feature Drop | 2025.1.2 or higher.
- JDK version 17.
- Android Gradle plugin version 8.12.2.
- Gradle version 8.14.3.
Java compatibility
The TomTom Maps and Navigation SDK is built with Kotlin, the official language recommended by Google for Android development. Kotlin is interoperable with Java, so Java-based applications should be able to interact with its APIs despite Kotlin being the primary target. Contact us if you encounter any issues when using Java in your application.
Flavors
Maps and Navigation SDK is available in two flavors: complete and extended.
complete: enables common use cases for a Turn-by-Turn navigation application. It allows developers to get started building a complete Navigation solution with the SDK using the extensive guides in the API reference and the Developer Portal. Your go-to flavor when the available configurability is sufficient for your targeted user experience.extended: additional scope of the SDK with an extended feature set and additional configurability.
The Extended flavor of Maps and Navigation SDK for Android is only available upon request. Contact us to get started.
Project setup
Now that you’ve ensured your environment meets the requirements, proceed setting up your Android project with the TomTom Maps and Navigation SDK.
-
Create a new Android Studio project with an empty activity or open an existing one, and ensure Gradle is used in your project.
-
Set the minimum SDK API level to at least 26 (Android 8.0 "Oreo") and limit the ABIs to the supported set (arm64-v8a and x86_64) by making the following changes in the
androidblock of your app’sbuild.gradle.ktsfile.Note that it is required to configure the Maps and Navigation SDK flavor by setting the appropriate missingDimensionStrategy as below.
1android {2 defaultConfig {3 minSdk = 264 ndk {5 abiFilters += listOf("arm64-v8a", "x86_64")6 }78 missingDimensionStrategy("tomtom-sdk-version", "complete")9 }10} -
To prevent potential errors during app start-up, it’s important to ensure that OpenGL ES 3.0 support is enabled in the Android Studio emulator. If your emulator supports it, navigate to Settings, choose "Renderer maximum (up to OpenGL ES 3.1)" for the "OpenGL ES API level (requires restart)" field, and then restart the emulator to apply the changes.
Configuring project dependencies
-
Add a maven block to your
settings.gradle.ktsfile to specify the URI for repositories.tomtom.com. Credentials block is only needed for theextendedflavor of the SDK and you will have to use your own credentials.1val repositoriesTomtomComUsername: String by extra2val repositoriesTomtomComPassword: String by extra34dependencyResolutionManagement {5 repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)6 repositories {7 google()8 mavenCentral()9 maven {10 // Artifactory credentials is only needed if you use the extended flavor of the SDK11 credentials {12 username = repositoriesTomtomComUsername13 password = repositoriesTomtomComPassword14 }15 url = uri("https://repositories.tomtom.com/artifactory/maven")16 }17 }18} -
Verify that the maven repository is correctly integrated by adding a Navigation SDK dependency to the
build.gradle.ktsfile of your application module. For example,com.tomtom.sdk:init. Synchronize the project.val version = "2.1.2"implementation("com.tomtom.sdk:init:$version") -
Get your TomTom API key from my.tomtom.com by selecting the Maps and Navigation SDK for Android in the Product catalog.
-
Store the TomTom API key to a project property in your project
gradle.propertiesfile. Replaceapi_key_placeholderwith the actual TomTom API key.tomtomApiKey=api_key_placeholder -
If you get errors with the API key and you want to verify that you have set it up correctly, you can clone the TomTom Example App and run it. If you can see the map, the API key has been configured properly.
-
In the
build.gradle.ktsfile, map the TomTom API key property to a custom field of the gradleBuildConfigclass in theandroidblock of your app’sbuild.gradle.ktsfile.1val tomtomApiKey: String by project2android {3 buildFeatures {4 buildConfig = true5 }6 buildTypes.configureEach {7 buildConfigField("String", "TOMTOM_API_KEY", "\"$tomtomApiKey\"")8 }9}To use the TomTom API key in your application code, it is sufficient to access the newly added
BuildConfigfield.val apiKey = BuildConfig.TOMTOM_API_KEY