MapboxCarContext

class MapboxCarContext(val lifecycle: Lifecycle, val mapboxCarMap: MapboxCarMap)

This is the entry point for Mapbox Navigation in Android Auto. Create this object and then you have access to services and options for customization.

The lifecycle must come from a Session.getLifecycle or Screen.getLifecycle at this time.

Parameters

lifecycle

used to access the CarContext.

mapboxCarMap

controls the Mapbox car map surface.

Constructors

Link copied to clipboard
fun MapboxCarContext(lifecycle: Lifecycle, mapboxCarMap: MapboxCarMap)

Functions

Link copied to clipboard
fun customize(action: MapboxCarOptions.Customization.() -> Unit): MapboxCarContext

Allows you to define values used by the Mapbox Android Auto Navigation SDK.

Properties

Link copied to clipboard
val carContext: CarContext

Gives access to the CarContext. Throws an IllegalStateException when accessed before the lifecycle is Lifecycle.State.CREATED

Link copied to clipboard
val lifecycle: Lifecycle

Gives access to the Lifecycle that owns the CarContext.

Link copied to clipboard
val mapboxCarMap: MapboxCarMap

MapboxCarMap controls the Mapbox car map surface

Link copied to clipboard
val mapboxCarStorage: MapboxCarStorage

Access to persistent storage. Throws an IllegalStateException when accessed before the lifecycle is Lifecycle.State.CREATED.

Link copied to clipboard
val mapboxNavigationManager: MapboxCarNavigationManager

Integrates Mapbox with the car libraries NavigationManager. Gives access to the auto drive state. Throws an IllegalStateException when accessed before the lifecycle is Lifecycle.State.CREATED.

Link copied to clipboard
val mapboxScreenManager: MapboxScreenManager

Control the screens shown with the MapboxScreenManager.

Link copied to clipboard
val options: MapboxCarOptions

Options available for customizing Mapbox Android Auto Navigation.

Link copied to clipboard
val routePreviewRequest: CarRoutePreviewRequest

Control and access the route preview.

Extensions

Link copied to clipboard
fun MapboxCarContext.prepareScreens(): MapboxCarContext

This is a predefined application that is designed to collect feedback from drivers.