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 path for cache storage.

Throws

if the cache storage directory path 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 path for cache storage.

Throws

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