Links

Auto start

If you want to enable the automatic trip detection mode, DriveKitTripAnalysis.activateAutoStart(true)must be called once the Activity Recognition runtime permission is granted by the user. Read more.
The automatic mode detects vehicle movements and triggers the trip analysis without driver intervention while the application is in background. The analysis is stopped automatically at the end of the trip.
This feature is recommended to avoid driver distraction and phone handling while driving. The automatic mode has been optimized to limit the battery drain.
By default, automatic trip detection is disabled, but you can enable it by calling the following method:
Kotlin
Java
DriveKitTripAnalysis.activateAutoStart(true)
DriveKitTripAnalysis.INSTANCE.activateAutoStart(true);
To disable automatic trip detection, call the same method with parameter activate set to false
Kotlin
Java
DriveKitTripAnalysis.activateAutoStart(false)
DriveKitTripAnalysis.INSTANCE.activateAutoStart(false);
If a trip is running when automatic trip detection is disabled, the trip will not be canceled. If you want to cancel the trip, you should also call cancelTrip method.