LogoLogo
ProductsUse casesDocsSupport
  • Introducing DriveKit
  • DriveKit Guides
  • Get started with drivekit
    • Trip recording lifecycle
    • iOS
      • 🚀Quick start
      • Advanced configurations
      • References
      • iOS DriveKit Demo App
    • Android
      • 🚀Quick start
      • Advanced configurations
      • References
      • Android DriveKit Demo App
      • Android 15 Migration guide
      • Android 14 Migration guide
      • Troubleshooting
  • Trip analysis
    • Introduction
    • iOS
      • Permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (iOS)
    • Android
      • Runtime permissions
      • Trip management
      • TripListener
      • Crash Detection
      • Beacon usage
      • Bluetooth usage
      • Custom metadata
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
      • Android
        • Get started
        • Working hours
        • Driver alert in case of crash
        • Trip recording widget
        • Location sharing
    • REST services
      • Trip
      • References
    • Trip Simulator
      • iOS
      • Android
  • PERMISSIONS UTILS
    • Introduction
    • User interface
      • iOS
        • Get started
        • Main configurations
      • Android
        • Get started
        • Main configurations
  • COMMON UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
    • References
  • DRIVER DATA
    • Introduction
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
      • Android
        • Get Started
        • Advanced configurations
        • Trips widgets
        • My Synthesis
        • My Driver Profile
  • Driver Data Timeline UI
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • Vehicle
    • Introduction
    • iOS
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (iOS)
    • Android
      • Get started
      • Vehicle management
      • Beacon management
      • Bluetooth device management
      • Odometer
      • References (Android)
    • User interface
      • iOS
        • Get started
        • Main configurations
        • Advanced configurations
      • Android
        • Get started
        • Main configurations
        • Advanced configurations
  • DRIVER ACHIEVEMENT
    • Introduction
    • iOS
      • Get started
    • Android
      • Get Started
    • User interface
      • iOS
      • Android
  • CHALLENGE
    • Introduction
    • Important challenge rules
    • iOS
      • Get started
      • References (iOS)
    • Android
      • Get started
      • References (Android)
    • User interface
      • iOS
        • Get started
      • Android
        • Get started
  • GROUP
    • Introduction
    • iOS
      • Get started
    • Android
      • Get started
  • React Native
    • Get started
    • Integration
  • Flutter
    • Get started
    • Integration
  • Push services
    • Introduction
    • Push Trip Data
    • Push Deleted trip
    • Push Crash Data
    • Push Diagnosis Data
  • ADMIN SERVICES
    • Beacon
      • Add
      • Replace
      • Delete
      • Configuration
    • Challenges
      • List of challenges
      • Challenge details
      • Registered users
      • Challenge ranking
      • Users' progress
      • Definitions
    • Customer
      • Activity timeline
    • Driver
      • Timeline
      • Synthesis
      • Identity
      • Status
      • Add or update a metadata
      • Vehicles
      • Profile
      • Application diagnoses
    • Drivers
      • Account
      • Statistics
      • Ranking
      • Expired accounts
    • Group
      • Timeline
      • Synthesis
    • Trips
      • Add or update a metadata
      • Delete a metadata
    • Vehicle
      • Create
      • Characteristics
      • Configuration
      • Statistics
      • Update mileage
      • Tire and brake wear update
      • References
  • Crashes
    • Annotate a crash
    • Revoke crash location URL
  • ENTERPRISE SERVICES
    • Introduction
    • Teams
      • Create a team
      • List of teams
      • Enable or disable a team
    • Hyper-admins
      • Create a hyper-admin
      • List of hyper-admins
      • Delete a hyper-admin
    • Monitoring
      • Get a push trip data report
      • Get a push crash data report
      • Request to retry failed trips
      • Request to retry failed crashes
      • Get the status of a task
  • Release notes
    • Changelog
      • iOS
      • Android
      • UI iOS
      • UI Android
Powered by GitBook
On this page
  • Integration
  • Usage
  • Enable Developer Mode
  • Mock Location App
  • Simulate a trip
  • Stop the simulation
  • Simulate a crash during a trip
  • Check if it’s the no-op module

Was this helpful?

Export as PDF
  1. Trip analysis
  2. Trip Simulator

Android

Integration

The Trip Simulator component includes two modules:

  • The first module is used as a testing tool for your debug application.

  • The second module is a “no-op” module. It will do nothing and does not include any trip data: it’s an empty implementation that mirrors the public methods and objects of the first module which can be integrated into your release-mode application to maintain a consistent codebase across both debug and release modes without embedding the real trip simulator in production.

To include the Trip Simulator module in your app, insert the following lines into the dependencies section of your application's build.gradle file:

dependencies {
    debugImplementation 'com.drivequant.drivekit:drivekit-trip-simulator:$drivekit_version'
    releaseImplementation 'com.drivequant.drivekit:drivekit-trip-simulator-noop:$drivekit_version'
}

Replace $drivekit_version with the DriveKit version you are using in your app

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 component will receive the configured callbacks automatically.

Name
Duration (min)
Distance (km)
Description

SHORT_TRIP

8

2

Trip too short that does not allow to rate the driver's behavior

MIXED_TRIP

15

12

A mixed trip in urban and suburban areas

CITY_TRIP

20

8

A city trip

SUBURBAN_TRIP

30

30

A trip performed in a suburban environment mostly

HIGHWAY_TRIP

55

100

A highway trip

TRAIN_TRIP

10

5

Trip recorded in a train to test the alternative transportation modes detection

BUS_TRIP

13

3

Trip recorded in a bus to test the alternative transportation modes detection

BOAT_TRIP

40

25

Trip recorded in a boat to test the alternative transportation modes detection

TRIP_WITH_CRASH_1

5

1

A trip to simulate an unconfirmed or a confirmed crash.

TRIP_WITH_CRASH_2_STILL_DRIVING

23

24

A trip to simulate an accident confirmed less than two minutes after the start of the trip, after which the driver continued driving.

Enable Developer Mode

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 following method with a appropriate configuration with the PresetTrip parameter.

fun start(presetTrip: PresetTrip, listener: DKTripSimulatorListener? = null): Boolean

Stop the simulation

To stop the trip simulation, you must call the following method:

fun stop()

Otherwise you can manually remove your app as the mock location app in the developers settings.

Simulate a crash during a trip

In order to mock an accident to check your integration, you must choose between TRIP_WITH_CRASH_1 or TRIP_WITH_CRASH_2_STILL_DRIVING as PresetTrip parameter:

Possible values for PresetTripCrash1 enum used by TRIP_WITH_CRASH_1 are described in the table below:

Name
Description

CONFIRMED_30KMH

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.

CONFIRMED_20KMH

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.

CONFIRMED_10KMH

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.

UNCONFIRMED_0KMH

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.

DriveKitTripSimulator.start(PresetTrip.TRIP_WITH_CRASH_1(PresetTripCrash1.CONFIRMED_30KMH.CONFIRMED_30KMH))
DriveKitTripSimulator.INSTANCE.start(new PresetTrip.TRIP_WITH_CRASH_1(PresetTripCrash1.CONFIRMED_30KMH));

Check if it’s the no-op module

To check whether the "no-op" module is embedded, you can execute the following code:

val isNoop = DriveKitTripSimulator.isNoop
final boolean isNoop = DriveKitTripSimulator.INSTANCE.isNoop();
PreviousiOSNextIntroduction

Last updated 3 months ago

Was this helpful?

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

official documentation