VehicleMetadataProvider

Creates an instance of VehicleMetadataProvider using the provided context and API key.

Note: A default URL is used to call the vehicle metadata API.

Return

A new instance of VehicleMetadataProvider.

Parameters

context

Application context.

apiKey

The API key for authenticating requests to the vehicle metadata service.


Creates an instance of VehicleMetadataProvider using the provided context, API key, and API URI.

Return

A new instance of VehicleMetadataProvider.

Parameters

context

Application context.

apiKey

The API key for authenticating requests to the vehicle metadata service.

apiUri

The Uri of the vehicle metadata API to use for requests.


fun VehicleMetadataProvider(context: Context, apiKey: String, apiUri: Uri = DEFAULT_API_URI, cacheDirectory: CacheDirectory = CacheDirectory.DefaultDirectory): VehicleMetadataProvider

Creates an instance of VehicleMetadataProvider using the provided context, API key, optional API Uri, and optional caching directory for storing vehicle details.

By providing a caching directory, you enable offline storage of vehicle details, which is essential for hybrid usage scenarios where both online and offline capabilities are required. If no caching directory is specified CacheDirectory.DefaultDirectory will be used.

Return

A new instance of VehicleMetadataProvider configured for hybrid usage.

Parameters

context

The application context, which provides access to application-specific resources and classes.

apiKey

The API key necessary for authenticating requests to the vehicle metadata service.

apiUri

The Uri of the vehicle metadata API to use for requests. If not provided, DEFAULT_API_URI will be used.

cacheDirectory

An optional CacheDirectory for storing vehicle details offline. This can be either a default directory, a writable directory specified by the user, or no directory at all. If not provided, CacheDirectory.DefaultDirectory will be used.