Get started
Prerequisite
Before starting DriveKit Vehicle UI integration, make sure that you have initialized Vehicle and Common UI components, especially if you have disabled the SDK auto-initialization.
Integration
To add Vehicle UI module to your app, add the following line to your dependencies in your application build.gradle file:
dependencies {
implementation 'com.drivequant.drivekit:drivekit-vehicle-ui:$drivekitui_version'
}Initialization
If you have disabled the SDK auto-initialization, the Vehicle UI module must also be manually initialized.
Then, to initialize the module in your app, you must call the initialization method in onCreate method of your Application class:
fun initialize()Display vehicle list
To display the vehicle list to the driver, just call the following method:
DriveKitNavigationController.vehicleUIEntryPoint?.startVehicleListActivity(context)final VehicleUIEntryPoint vehiclesEntryPoint = DriveKitNavigationController.INSTANCE.getVehicleUIEntryPoint();
if (vehiclesEntryPoint != null) {
vehiclesEntryPoint.startVehicleListActivity(getContext());
}
Display vehicle detail
To display the vehicle detail, just call the following method:
DriveKitNavigationController.vehicleUIEntryPoint?.startVehicleDetailActivity(context, vehicleId)final VehicleUIEntryPoint vehiclesEntryPoint = DriveKitNavigationController.INSTANCE.getVehicleUIEntryPoint();
if (vehiclesEntryPoint != null) {
vehiclesEntryPoint.startVehicleDetailActivity(getContext(), vehicleId);
}
Display vehicle picker
To display vehicle selection screens, just call the following method:
VehiclePickerActivity.launchActivity(
context: Context,
vehicleToDelete: Vehicle? = null,
listener : VehiclePickerCompleteListener? = null)VehiclePickerActivity.Companion.launchActivity(context: Context);VehiclePickerCompleteListener: This callback is called when VehiclePickerActivity has finishedvehicleToDelete: If you want to replace your vehicle, you can use this parameter, it will delete and create a new one.
Last updated
Was this helpful?

