DriverContext

  • DriverContext provides dependencies for creating a DriverApi instance, essential for interacting with the Driver SDK.

  • It offers access to key components like application context, authentication token factory, navigation tools, and provider/vehicle identifiers.

  • Developers can utilize the DriverContext.Builder to construct and customize DriverContext instances according to their specific needs.

  • A DriverStatusListener can be attached to receive updates and potential error logs related to the driver's status.

  • Methods like getRoadSnappedLocationProvider and getNavigator enable access to advanced location and navigation features within the SDK.

public abstract class DriverContext extends Object

DriverContext provides the dependencies needed to construct a DriverApi instance.

Nested Class Summary

class DriverContext.Builder Builder for DriverContext. 
interface DriverContext.DriverStatusListener Listener for status updates with the capability of getting the cause of an error log. 

Public Constructor Summary

Public Method Summary

static DriverContext.Builder
builder(Application application)
Returns new default Builder instance.
abstract Application
getApplication()
Returns the application context.
abstract AuthTokenContext.AuthTokenFactory
getAuthTokenFactory()
Returns the factory for generating JWT for the given call context.
abstract DriverContext.DriverStatusListener
getDriverStatusListener()
Returns the optional listener for status updates with the capability of received the cause of error logs.
String
getFleetEngineServiceAddress()
Returns the FleetEngine service address defined in the Android Manifest or falls back to the default value.
abstract Navigator
getNavigator()
Returns the initialized Navigator singleton.
abstract String
getProviderId()
Returns the unique identifier for this provider.
abstract RoadSnappedLocationProvider
getRoadSnappedLocationProvider()
Returns the RoadSnappedLocationProvider from the NavigationApi.
abstract String
getVehicleId()
Returns the unique identifier for this vehicle for this provider.
abstract DriverContext.Builder
toBuilder()
Returns new Builder instance set with current DriverContext state.

Inherited Method Summary

Public Constructors

public DriverContext ()

Public Methods

public static DriverContext.Builder builder (Application application)

Returns new default Builder instance.

public abstract Application getApplication ()

Returns the application context.

public abstract AuthTokenContext.AuthTokenFactory getAuthTokenFactory ()

Returns the factory for generating JWT for the given call context.

public abstract DriverContext.DriverStatusListener getDriverStatusListener ()

Returns the optional listener for status updates with the capability of received the cause of error logs.

public String getFleetEngineServiceAddress ()

Returns the FleetEngine service address defined in the Android Manifest or falls back to the default value.

public abstract Navigator getNavigator ()

Returns the initialized Navigator singleton.

public abstract String getProviderId ()

Returns the unique identifier for this provider.

public abstract RoadSnappedLocationProvider getRoadSnappedLocationProvider ()

Returns the RoadSnappedLocationProvider from the NavigationApi.

public abstract String getVehicleId ()

Returns the unique identifier for this vehicle for this provider.

public abstract DriverContext.Builder toBuilder ()

Returns new Builder instance set with current DriverContext state.