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
1
val maxVehicles = 1
2
DriveKitVehicleUI.configureMaxVehicles(maxVehicles)
Copied!
1
int maxVehicles = 1;
2
DriveKitVehicleUI.INSTANCE.configureMaxVehicles(maxVehicles);
Copied!
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
1
val canAddVehicle = true
2
DriveKitVehicleUI.enableAddVehicle(canAddVehicle)
Copied!
1
boolean canAddVehicle = true;
2
DriveKitVehicleUI.INSTANCE.enableAddVehicle(canAddVehicle);
Copied!
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 select the features that are visible and accessible to the user as well as the order in which these features are displayed. The possible actions are : delete the vehicle, replace the vehicle, rename the vehicle, technical data display and manage the vehicle mileage.
You can select which actions you want to display by calling the following method:
Kotlin
Java
1
DriveKitVehicleUI.configureVehicleActions(
2
listOf(VehicleAction.SHOW, VehicleAction.RENAME, VehicleAction.REPLACE, VehicleAction.DELETE, VehicleAction.ODOMETER)
3
)
Copied!
1
DriveKitVehicleUI.INSTANCE.configureVehicleActions(
2
Arrays.asList(
3
VehicleAction.SHOW,
4
VehicleAction.RENAME,
5
VehicleAction.REPLACE,
6
VehicleAction.DELETE,
7
VehicleAction.ODOMETER));
Copied!
Settings:
  • SHOW: the user can display the vehicle characteristics.
  • RENAME: the user can rename the vehicle.
  • REPLACE: the user can replace the vehicle.
  • DELETE: the user can delete the vehicle.
  • ODOMETER: the user can enter a mileage value manually.
Default values: [SHOW, RENAME, REPLACE, DELETE, ODOMETER]

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
1
val canRemoveBeacon = true
2
DriveKitVehicleUI.enableRemoveBeacon(canRemoveBeacon)
3
Copied!
1
boolean canRemoveBeacon = true;
2
DriveKitVehicleUI.INSTANCE.enableRemoveBeacon(canRemoveBeacon);
Copied!
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
1
DriveKitVehicleUI.configureVehicleCategories(
2
listOf(VehicleCategory.MICRO, VehicleCategory.COMPACT, ...)
3
)
Copied!
1
DriveKitVehicleUI.INSTANCE.configureVehicleCategories(
2
Arrays.asList(VehicleCategory.MICRO, VehicleCategory.COMPACT,)
3
);
Copied!
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
1
DriveKitVehicleUI.configureBrands(
2
listOf(VehicleBrand.ABARTH, VehicleBrand.ALFA_ROMEO, ...)
3
)
Copied!
1
DriveKitVehicleUI.INSTANCE.configureBrands(
2
Arrays.asList(VehicleBrand.ABARTH, VehicleBrand.ALFA_ROMEO, ...)
3
);
Copied!
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
1
DriveKitVehicleUI.configureEngineIndexes(
2
listOf(VehicleEngineIndex.GASOLINE, VehicleEngineIndex.DIESEL, ...)
3
)
Copied!
1
DriveKitVehicleUI.INSTANCE.configureEngineIndexes(
2
Arrays.asList(VehicleEngineIndex.GASOLINE, VehicleEngineIndex.DIESEL, ...)
3
);
Copied!
Settings:
  • GASOLINE
  • DIESEL
  • ELECTRIC
  • GASOLINE_HYBRID
  • DIESEL_HYBRID
Default values: [GASOLINE, DIESEL, ELECTRIC, GASOLINE_HYBRID, DIESEL_HYBRID]
Last modified 1mo ago