Beacon usage

The Beacon-based trip detection is only available on Android 21 (5) or later versions because it uses some methods from Android SDK not available before Android 21 (5). For devices running a lower version, the beacons will have no effect on the SDK auto-start feature.

If beacon detection is a major feature of your application, consider changing the minimal SDK version of your application to Android 21 (5).

Configure beacons

The automatic trip detection feature is compliant with iBeacon Bluetooth beacons. A beacon is a Bluetooth low energy (BLE) device that broadcasts a universally unique identifier. This signal can be detected by the SDK and used to trigger the trip analysis.

In addition, the beacon is a smart and cost-effective solution for identifying the vehicle in which the driver is travelling.

The DriveKit SDK is fully compatible with the Apple iBeacon™ standard.

You can add beacon identifiers to Trip Analysis SDK by calling the following method:

Kotlin
Java
Kotlin
val beacon = BeaconData("699ebc80-e1f3-11e3-9a0f-0cf3ee3bc012", 1, 2)
DriveKitTripAnalysis.setBeacons(listOf(beacon))
Java
List<BeaconData> beacons = new ArrayList<>();
BeaconData beacon = new BeaconData("699ebc80-e1f3-11e3-9a0f-0cf3ee3bc012", 1, 2);
beacons.add(beacons);
DriveKitTripAnalysis.INSTANCE.setBeacons(beacons);

A detailed description of BeaconData class is available here.

If you want to ignore major and minor values for trip detection, set them to -1.

If you want to remove beacons from SDK configuration, just call the method with an empty array.

Beacon required

To avoid the recording of unwanted trips (trips performed outside the vehicle where the beacon is placed), it is possible to automatically cancel the trip if the beacon is not "seen" several times during the trip. Generally, a trip will be cancelled in less than 6 minutes if the beacon is not in the vehicle.

By default, this setting is disabled but you can enable it by calling the following method:

Kotlin
Java
Kotlin
DriveKitTripAnalysis.setBeaconRequired(true)
Java
DriveKitTripAnalysis.INSTANCE.setBeaconRequired(true);

To disable this settings, call the same method with the parameter set to false

Kotlin
Java
Kotlin
DriveKitTripAnalysis.setBeaconRequired(false)
Java
DriveKitTripAnalysis.INSTANCE.setBeaconRequired(false);