Advanced configuration

Custom stop timeout

A trip being analyzed is automatically terminated after a period of inactivity (which begins when the vehicle has stopped). The DriveQuant SDK allows to set the end-of-trip duration.

By default, the trip analysis is stopped after 240 seconds. This value can be tuned according to your need and you can choose any integer values between 120 and 480 seconds by calling the following method:

Kotlin
Java
Kotlin
DriveKitTripAnalysis.setStopTimeOut(180)
Java
DriveKitTripAnalysis.INSTANCE.setStopTimeOut(180);

If a value greater than 480 is set, the value will be forced to 480.

If a value lower than 120 is set, the value will be forced to 120.

Custom metadata

If your use case requires it, it is possible to add your own data in the trip analysis request. For example, it can be data that is specific to your trip, application or user identification system.

You can add additional metadata to your trip by calling the following method:

Kotlin
Java
Kotlin
DriveKitTripAnalysis.setTripMetaData(metaData)
Java
DriveKitTripAnalysis.INSTANCE.setTripMetaData(metaData);

The metadata must be represented as a key/value object where the key and value have a String type.

If metadata are sent, they will also be added to the push data request in the metaData field.

Sharing data during the trip

The Trip Analysis component records the trip locally while it is in progress. The data are recorded with a period of one point per second. At the end of the trip, the SDK requests the driving analysis service and then retrieves the driving indicators.

In addition to this feature, the SDK is also able to share data with the server before the trip is completed. The data is transmitted at a lower frequency with a time interval of one point per minute.

The system for sharing information during the trip can be used in a vehicle fleet management system. This feature requires access to specific APIs. For more information, contact DriveQuant.

Sharing information with the server allows you to store the trip data even if it has been interrupted, and if the data post at the end of the trip could not be performed. This can happen in very rare cases such as the destruction of the mobile phone.

By default, this setting is disabled but you can enable it by calling the following method:

Kotlin
Java
Kotlin
DriveKitTripAnalysis.enableSharePosition(true)
Java
DriveKitTripAnalysis.INSTANCE.enableSharePosition(true);

To disable this setting, call the same method with the parameter set to false

Kotlin
Java
Kotlin
DriveKitTripAnalysis.enableSharePosition(false)
Java
DriveKitTripAnalysis.INSTANCE.enableSharePosition(false);

Here is the list of data shared every minute by the SDK:

  • Date of trip start.

  • Duration of the trip in seconds.

  • Distance traveled in km.

  • Longitude of the current location.

  • Latitude of the current location.

  • Smartphone battery level.

  • StartMode of the trip recording: manual, GPS-based or beacon-based.

  • Beacon parameters: uuid, major, minor.