NdsStore

@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
fun NdsStore(context: Context, ndsStorePath: File, apiKey: String, failureListener: NdsStoreFailureListener?, geopoliticalView: String = DEFAULT_GEOPOLITICAL_VIEW, init: NdsStoreConfiguration.() -> Unit = {}): NdsStore

Creates an instance of NdsStore with the default NdsStoreUpdateConfiguration. NdsStoreUpdateConfiguration.apiKey is set to the given apiKey. The paths NdsStoreUpdateConfiguration.updateStoragePath and NdsStoreUpdateConfiguration.persistentStoragePath are taken from the given context. The paths are inside the application's external files directory, or the files directory if the external files directory is not available.

Return

An instance of NdsStore that is configured based on the provided parameters.

Parameters

context

The Context used for creating the NdsStore.

ndsStorePath

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

apiKey

API key required for authentication to the NDS Store update service and the traffic cloud service. Providing a valid API key is essential to enable traffic data in the NDS Store. Without a valid API key, access to traffic data will be restricted, and the traffic information will not be available in the data store. Traffic data will also be available from NdsStore when the valid apiKey is not provided through this argument but is supplied to NavigationTileStore instead.

failureListener

An optional listener for handling errors related to the NDS store. Errors may occur during initialization or later during usage. If the listener is null, initialization will fail with an exception if the NDS store is missing or invalid. If the listener is not null, initialization will succeed even if the NDS store is missing or invalid, and any errors will be reported through the listener.

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 which is the unified international geopolitical view. The default will also be used if the given geopolitical view is not available.

init

A lambda function that allows for additional configuration of the NdsStoreConfiguration before the store is created. Defaults to an empty lambda.

Throws

if a configuration field is invalid.


@RestrictToExtendedFlavor(value = [ExternalScope.LIBRARY_GROUP])
fun NdsStore(context: Context, ndsStorePath: File, apiKey: String, geopoliticalView: String = DEFAULT_GEOPOLITICAL_VIEW, init: NdsStoreConfiguration.() -> Unit = {}): NdsStore

Deprecated

This will be removed from future releases after 2027-03-10.

Replace with

NdsStore(context, ndsStorePath, apiKey, null, geopoliticalView, init)

Creates an instance of NdsStore with the default NdsStoreUpdateConfiguration. NdsStoreUpdateConfiguration.apiKey is set to the given apiKey. The paths NdsStoreUpdateConfiguration.updateStoragePath and NdsStoreUpdateConfiguration.persistentStoragePath are taken from the given context. The paths are inside the application's external files directory, or the files directory if the external files directory is not available.

Return

An instance of NdsStore that is configured based on the provided parameters.

Parameters

context

The Context used for creating the NdsStore.

ndsStorePath

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

apiKey

API key required for authentication to the NDS Store update service and the traffic cloud service. Providing a valid API key is essential to enable traffic data in the NDS Store. Without a valid API key, access to traffic data will be restricted, and the traffic information will not be available in the data store.

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 which is the unified international geopolitical view. The default will also be used if the given geopolitical view is not available.

init

A lambda function that allows for additional configuration of the NdsStoreConfiguration before the store is created. Defaults to an empty lambda.

Throws

if a configuration field is invalid.