Project set up
To use Maps SDK in your application you need to obtain a TomTom API key by following these instructions. Remember to keep your API key secure.
This guide describes how to prepare your Android project for using TomTom SDKs.
- Install Android Studio if you don’t already have it.
- Create a new project or open an existing one. Make sure that the minimum SDK API level is set to at least 21 (Android 5.0 "Lollipop") and that compile SDK API level is set to 31.
- Add the
packagingOptions
.1android {2 ...3 packagingOptions {4 jniLibs.pickFirsts.add("lib/**/libc++_shared.so")5 }6} - To get access to the TomTom SDK repository, add the following to your
settings.gradle
file1dependencyResolutionManagement {2 repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)3 repositories {4 google()5 mavenCentral()6 maven {7 url = uri("https://repositories.tomtom.com/artifactory/maven")8 }9 }10} - Add the dependencies that you need in your application to your module’s
build.gradle
file and synchronize the project.
Next steps
Now that you’ve set up your project, here are some suggestions for what to do with it: