Android

Integration

To add the Trip Simulator module to your app, add the following line to your dependencies in your application build.gradle file:
1
dependencies {
2
debugImplementation 'com.drivequant.drivekit:drivekit-trip-simulator:1.10.0'
3
}
Copied!
This component has been designed to facilitate preliminary testing and should never remain in your production app. In order to avoid building the Trip Simulator module in release mode, it is recommended to build it with debugImplementation.

Usage

DriveQuant offers the possibility of running simulations from a list of preset trips. After integrating and activating the trip simulation component, you can select a preset trip from those described in the table below. Once the simulation is launched, the Trip Analysis SDK will receive the configured callbacks automatically.
Name
Duration (s)
Distance (m)
Description
SHORT_TRIP
527
1794
Trip too short that does not allow to rate the driver's behavior
MIXED_TRIP
897
12210
A 15-minute mixed trip in urban and suburban areas
CITY_TRIP
1174
8 427
A 20-minute city trip
SUBURBAN_TRIP
1752
30126
A 30-minute trip performed in a suburban environment mostly
HIGHWAY_TRIP
3345
101840
A 55-minute highway trip
TRAIN_TRIP
640
14985
Trip recorded in a train to test the alternative transportation modes detection
BOAT_TRIP
24612
2459
Trip recorded in a boat to test the alternative transportation modes detection

Enable Developer Mode

The user must enable the developer mode in Android. The official documentation explains well how to proceed.

Mock Location App

In the Debugging category, tap on Select mock location app and select yours. It sometimes appears that you might uninstall and reinstall your app on the device in order to register it as a mock location app.

Simulate a trip

To simulate a trip, call the start method in TripSimulator with a appropriate configuration with the PresetTrip parameter.
Kotlin
Java
1
DriveKitTripSimulator.start(PresetTrip.MIXED_TRIP)
Copied!
1
DriveKitTripSimulator.INSTANCE.start(PresetTrip.MIXED_TRIP);
Copied!

Stop the simulation

To stop the trip simulation, you must call the stop method in TripSimulator:
Kotlin
Java
1
DriveKitTripSimulator.stop()
Copied!
1
DriveKitTripSimulator.INSTANCE.stop();
Copied!
Otherwise you can manually remove your app as the mock location app in the developers settings
Last modified 7mo ago