To add the Trip Simulator module to your app, add the following line to your dependencies in your application build.gradle file:
$drivekit_versionwith the DriveKit version you are using in your app
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
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 component will receive the configured callbacks automatically.
Trip too short that does not allow to rate the driver's behavior
A 15-minute mixed trip in urban and suburban areas
A 20-minute city trip
A 30-minute trip performed in a suburban environment mostly
A 55-minute highway trip
Trip recorded in a train to test the alternative transportation modes detection
Trip recorded in a bus to test the alternative transportation modes detection
Trip recorded in a boat to test the alternative transportation modes detection
A trip dedicated to simulate a crash.
The user must enable the developer mode in Android. The official documentation explains well how to proceed.
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.
To simulate a trip, call the start method in
TripSimulatorwith a appropriate configuration with the
To stop the trip simulation, you must call the stop method in
Otherwise you can manually remove your app as the mock location app in the developers settings.
In order to mock a crash to check your integration, you must choose the TRIP_WITH_CRASH PresetTrip item, with a CrashType object as parameter. Possible values for PresetCrashConfiguration enumeration are described in the table below:
A short trip with a collision at 30 km/h that occurs 137 seconds after the trip begins and that corresponds to a confirmed accident.
A short trip with a collision at 20 km/h that occurs 141 seconds after the trip begins and that corresponds to a confirmed accident.
A short trip with a collision at 10 km/h that occurs 146 seconds after the trip begins and that corresponds to a confirmed accident.
A short trip with a collision during a vehicle stop that occurs 159 seconds after the trip begins and that corresponds to an unconfirmed accident.