buildSdkConfiguration

fun buildSdkConfiguration(context: Context, apiKey: String, telemetryUserConsent: suspend () -> UserConsent, geopoliticalView: String = DEFAULT_GEOPOLITICAL_VIEW, coreConfiguration: CoreConfiguration.Builder2.() -> Unit = {}, cacheStorageConfiguration: CacheStorageConfiguration.Builder.() -> Unit = {}): SdkConfiguration

Builder function to create an SdkConfiguration for online-only usage.

Return

An instance of SdkConfiguration configured for online-only usage.

Parameters

context

The application context.

apiKey

Your TomTom API key.

telemetryUserConsent

A suspend function that provides the initial UserConsent for telemetry. In some jurisdictions, enabling the collection of TomTom Telemetry data comes with specific legal requirements. Application developers must consult applicable regulations before enabling TomTom telemetry collection.

geopoliticalView

The country code in the ISO 3166-1 alpha-3 format whose view on disputed areas should be used. Defaults to DEFAULT_GEOPOLITICAL_VIEW.

coreConfiguration

Lambda to configure core settings via CoreConfiguration.Builder2. Allows configuration of telemetry user consent and location interceptor.

cacheStorageConfiguration

Lambda to configure cache storage settings via CacheStorageConfiguration.Builder. Allows configuration of the directory paths for cache storage and the local map display assets.

Throws

if the cache storage directory path is not absolute or cannot be created.


fun buildSdkConfiguration(context: Context, apiKey: String, regionStorePath: File, telemetryUserConsent: suspend () -> UserConsent, geopoliticalView: String = DEFAULT_GEOPOLITICAL_VIEW, coreConfiguration: CoreConfiguration.Builder2.() -> Unit = {}, cacheStorageConfiguration: CacheStorageConfiguration.Builder.() -> Unit = {}, regionStoreConfiguration: RegionStoreConfiguration.Builder.() -> Unit = {}): SdkConfiguration

Builder function to create an SdkConfiguration for online-first usage with offline capabilities.

Return

An instance of SdkConfiguration configured for online-first usage with offline capabilities.

Parameters

context

The application context.

apiKey

Your TomTom API key.

regionStorePath

The local path to the region store directory. That is the directory that contains the file: ROOT.NDS.

telemetryUserConsent

A suspend function that provides the initial UserConsent for telemetry. In some jurisdictions, enabling the collection of TomTom Telemetry data comes with specific legal requirements. Application developers must consult applicable regulations before enabling TomTom telemetry collection.

geopoliticalView

The country code in the ISO 3166-1 alpha-3 format whose view on disputed areas should be used. Defaults to DEFAULT_GEOPOLITICAL_VIEW.

coreConfiguration

Lambda to configure core settings via CoreConfiguration.Builder2. Allows configuration of telemetry user consent and location interceptor.

cacheStorageConfiguration

Lambda to configure cache storage settings via CacheStorageConfiguration.Builder. Allows configuration of the directory paths for cache storage and the local map display assets.

regionStoreConfiguration

Lambda to configure region store settings. Allows configuration of keystore path, keystore password, and region store update settings via RegionStoreConfiguration. The region store created with this configuration can be retrieved later via com.tomtom.sdk.init.TomTomSdk.getOfflineRegionStore.

Throws

if the regionStorePath or keyStorePath (when provided) is not absolute or cannot be created.


fun buildSdkConfiguration(context: Context, apiKey: String, geopoliticalView: String = DEFAULT_GEOPOLITICAL_VIEW, coreConfiguration: CoreConfiguration.Builder.() -> Unit = {}, cacheStorageConfiguration: CacheStorageConfiguration.Builder.() -> Unit = {}): SdkConfiguration

Deprecated

This will be removed from future releases after 2026-10-07.

Replace with

buildSdkConfiguration(context, apiKey, { UserConsent.TelemetryOn }, geopoliticalView, coreConfiguration, cacheStorageConfiguration)

Builder function to create an SdkConfiguration for online-only usage.

Return

An instance of SdkConfiguration configured for online-only usage.

Parameters

context

The application context.

apiKey

Your TomTom API key.

geopoliticalView

The country code in the ISO 3166-1 alpha-3 format whose view on disputed areas should be used. Defaults to DEFAULT_GEOPOLITICAL_VIEW.

coreConfiguration

Lambda to configure core settings via CoreConfiguration.Builder. Allows configuration of telemetry user consent and location interceptor.

cacheStorageConfiguration

Lambda to configure cache storage settings via CacheStorageConfiguration.Builder. Allows configuration of the directory paths for cache storage and the local map display assets.

Throws

if the cache storage directory path is not absolute or cannot be created.