Advanced configurations

Maximum number of vehicles

A user can declare one or more vehicles. If you need to limit the number of configurable vehicle(s), you can set the parameter maxVehicles:

Kotlin
Java
Kotlin
val maxVehicles = 1
DriveKitVehicleUI.configureMaxVehicles(maxVehicles)
Java
int maxVehicles = 1;
DriveKitVehicleUI.INSTANCE.configureMaxVehicles(maxVehicles);

Settings:

  • A strictly positive integer

  • null: If you do not want to limit the number of configurable vehicles.

Default value: null

Authorization to add a vehicle

In some cases the vehicle can be pre-configured or you do not want the user to add a vehicle himself. Depending on your needs, it is possible to allow or restrict the vehicle to be added by the user. Call the following method to enable/disable the configuration:

Kotlin
Java
Kotlin
val canAddVehicle = true
DriveKitVehicleUI.enableAddVehicle(canAddVehicle)
Java
boolean canAddVehicle = true;
DriveKitVehicleUI.INSTANCE.enableAddVehicle(canAddVehicle);

Settings:

  • true: the user can add a vehicle

  • false: the user cannot add a vehicle

Default value: true

Configure vehicle actions

The Vehicle UI module lets you manage the actions that can be performed by the user on the vehicle. You can delete, replace, rename or show detail of a vehicle.

You can select which actions you want to display by calling the following method:

Kotlin
Java
Kotlin
DriveKitVehicleUI.configureVehicleActions(
listOf(VehicleAction.SHOW, VehicleAction.RENAME, VehicleAction.REPLACE, VehicleAction.DELETE)
)
Java
DriveKitVehicleUI.INSTANCE.configureVehicleActions(
Arrays.asList(VehicleAction.SHOW, VehicleAction.RENAME, VehicleAction.REPLACE, VehicleAction.DELETE)
);

Settings:

  • SHOW: the user can access the detail of a vehicle.

  • RENAME: the user can rename a vehicle.

  • REPLACE: the user can replace a vehicle.

  • DELETE: the user can delete a vehicle.

Default values: [SHOW, RENAME, REPLACE, DELETE]

Authorization to delete a beacon

If automatic trip recording with a beacon is mandatory in your application, you can block the deletion of a beacon and only allow its replacement. You can enable or disable this function using the following method:

Kotlin
Java
Kotlin
val canRemoveBeacon = true
DriveKitVehicleUI.enableRemoveBeacon(canRemoveBeacon)
Java
boolean canRemoveBeacon = true;
DriveKitVehicleUI.INSTANCE.enableRemoveBeacon(canRemoveBeacon);

Settings:

  • true: the user can delete a beacon

  • false: the user cannot delete a beacon

Default value: true

Select vehicle categories

The DriveKit Vehicle module contains a default category list (based on vehicle type). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in the car category list. You must not modify the value of the fields.

Kotlin
Java
Kotlin
DriveKitVehicleUI.configureVehicleCategories(
listOf(VehicleCategory.MICRO, VehicleCategory.COMPACT, ...)
)
Java
DriveKitVehicleUI.INSTANCE.configureVehicleCategories(
Arrays.asList(VehicleCategory.MICRO, VehicleCategory.COMPACT,)
);

Settings:

Car:

  • MICRO

  • COMPACT

  • SEDAN

  • SUV

  • MINIVAN

  • COMMERCIAL

  • LUXURY

  • SPORT

Truck:

  • TWO_AXLES_STRAIGHT_TRUCK

  • THREE_AXLES_STRAIGHT_TRUCK

  • FOUR_AXLES_STRAIGHT_TRUCK

  • TWO_AXLES_TRACTOR

  • THREE_AXLES_TRACTOR

  • FOUR_AXLES_TRACTOR

Default values: All categories are displayed by default (depending on the type).

By default, the values are all in the list. They will be displayed depending on the selected types.

Select brands

The DriveKit Vehicle module contains a default brand list (based on vehicle category). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in this list. You must not modify the value of the fields.

You can choose which brands to display by calling the following method:

Kotlin
Java
Kotlin
DriveKitVehicleUI.configureBrands(
listOf(VehicleBrand.ABARTH, VehicleBrand.ALFA_ROMEO, ...)
)
Java
DriveKitVehicleUI.INSTANCE.configureBrands(
Arrays.asList(VehicleBrand.ABARTH, VehicleBrand.ALFA_ROMEO, ...)
);

Settings:

  • VehicleBrand enum values

Default value: All brands are displayed by default.

Select engine types

The DriveKit Vehicle module contains a default engine type list (based on vehicle brand). It is recommended not to modify this list. If it is strictly necessary, it is possible to remove some values or to change the order of the values in this list. You must not modify the value of the fields.

You can choose which engine type(s) to display by calling the following method:

Kotlin
Java
Kotlin
DriveKitVehicleUI.configureEngineIndexes(
listOf(VehicleEngineIndex.GASOLINE, VehicleEngineIndex.DIESEL, ...)
)
Java
DriveKitVehicleUI.INSTANCE.configureEngineIndexes(
Arrays.asList(VehicleEngineIndex.GASOLINE, VehicleEngineIndex.DIESEL, ...)
);

Settings:

  • GASOLINE

  • DIESEL

  • ELECTRIC

  • GASOLINE_HYBRID

  • DIESEL_HYBRID

Default values: [GASOLINE, DIESEL, ELECTRIC, GASOLINE_HYBRID, DIESEL_HYBRID]