Crash Detection


Crash detection features, included into the DriveKit Trip Analysis component, is able to collect and analyse smartphone sensors data to automatically detect when a car accident occurs.

DriveKit Trip Analysis analyzes signals from the GPS sensor and also from the motion sensors (accelerometer, gyrometer and magnetometer).

This feature is enabled if the following conditions are fulfilled:

  • Your API key has the access rights to use this service;

  • You have enabled the feature by following the instructions described in this section;

  • A trip has been detected and is being analysed.

  • The smartphone's sensors are functional.

  • The SDK is able to check the status of the required sensors.

The crash detection steps are:

  1. A trip is detected automatically or started manually and the trip recording starts.

  2. The crash feature detects a potential collision based on motion sensors.

  3. The GPS and motion data are pushed to the backend analysis services in charge of the signal processing and crash confirmation.

  4. The SDK receives a crash analysis service response with a status.

  5. If the crash is confirmed, the Trip analysis component can display a survey to ask the driver whether he needs assistance. This is an optional feature.

Enable crash detection

If the crash detection configuration is enabled for your company, your API key carries out the feature access and the crash detection will be enabled accordingly.

However, you can deactivate and reactivate the function if necessary using a dedicated setting.

A method is available in DriveKitTripAnalysis to enable or disable the feature:

fun activateCrashDetection(activate: Boolean)

The crash detection comes with an optional feature to display an alert to the driver. This is described in the user interface section.

Verify that the feature is available

It is possible to check if the crash detection is available for your configuration by checking the following property:

val isCrashDetectionAvailable: Boolean

This property returns true if:

  • the required smartphone sensors are available and up and running;

  • your API key is allowed to use the feature;

If this property returns false, DriveKit will not start crash detection feature even if it has been previously activated with activateCrashDetection().

Configure crash detection feedback

Trip Analysis offers a mechanism to ask the user for feedback when an accident is confirmed by the crash analysis service.

Crash confirmation can be used to trigger a notification or display a screen which asks the driver to confirm the accident and whether assistance is required.

To use this function, you simply need to enable the interface with the following method and a DKCrashFeedbackConfig object:

fun enableCrashFeedback(config: DKCrashFeedbackConfig)

To disable the crash detection feedback, call the following method:

fun disableCrashFeedback()

Listening to Crash events

TripListener interface provides two callbacks for crash events:

  • crashDetected(crashInfo:DKCrashInfo), triggered when a crash event is detected

  • crashFeedbackSent(crashInfo:DKCrashInfo, feedbackType: CrashFeedbackType, severity:CrashFeedbackSeverity), triggered when crash feedback is enabled and a confirmed crash is detected. This callback will contain crash information and the feedback from the user.

To receive these callbacks, the smartphone must be connected to a mobile network and the accident detection feature must be enabled for your organisation's API key.

Last updated