This project is a sample app to show how to run offline modules using the TomTom Navigation SDK on Android.
Note: It's not a complete app that includes all TomTom Navigation SDK functionalities and implementations.
This is a reference implementation of the Android Offline Navigation Use Case tutorial for the TomTom Navigation SDK.
It does not include integration of the TPEG traffic module described in the tutorial.
An empty NDS store is included and this is populated using the device location, loading relevant map regions around the current location. For more information on offline map updates see the guide.
- Auto-download offline map for region around the user location
- Long press on the map to start a navigation
- Tap on the search result to start a navigation
- Navigation view
- Next instruction view
- Route line progress view
- Estimated time of arrival (ETA) view
- Lane guidance view
- Combined instruction view
- Route updated view
Because the repository for TomTom Navigation SDK is private, you will need to contact us to get access. Once you have obtained access,
- Go to repositories.tomtom.com and log in with your account.
- Expand the user menu in the top-right corner, and select "Edit profile" → "Generate an Identity Token".
- Copy your token and paste into global gradle.properties as mentioned in the next step.
Add the entries below to the global $HOME/.gradle/gradle.properties
file.
# required to access artifactory
repositoriesTomTomComUsername=###
repositoriesTomTomComPassword=###
# required in order to use TomTom's APIs
tomtomApiKey=###
ndsMapLicense=###
- The first time you launch the app you will be prompted to allow the app access to your location. Choose "While using the app".
- Initially the globe will be blank as the app is built with an empty NDS store. The app will need to be connected to the internet initially to download the map data for offline use.
- After a few seconds the current location marker will appear. Click the current location button to center on your location. The map data for the regions around the location will be downloaded. This can take around 30 seconds. After that time panning or zooming the map will trigger rendering with the downloaded map data.
The app is configured to default download the region around the user location. After running the project, the map
downloading process will start automatically. It may take time to download the map. You can follow the process in
the Network Inspector
in App Inspection
tool within Android Studio.
You can see the downloaded map when the downloading process finished as below.
Zoomed Out | Region Downloaded |
---|---|
You can enable the relevant maps region configuration as below.
val relevantRegionUpdateConfig: NdsStoreUpdaterConfiguration = defaultUpdaterConfiguration.copy(
relevantRegions = RelevantRegionsAutomaticUpdatesConfiguration(
radius = Distance.kilometers(10.0),
updateInterval = 60.minutes
)
)
When you set a route destination without a downloaded region, the region will be downloaded automatically and rendered in the map during the navigation continues.