Android
Prerequisite
Before integrating this module, ensure the following are in place:
The DriveKit SDK is initialized and a user has been created.
The Trip Analysis component is strongly recommended, as iBeacon detection is significantly enhanced during trip analysis — the scan mode is more efficient and the coverage range is greater.
Furthermore, iBeacon detection and location retrieval require the following runtime permissions:
Precise and background location permissions
Nearby devices permission
The feature also requires the Location and Bluetooth sensors to be enabled.
Integration
Add the following dependency to your app-level build.gradle:
dependencies {
implementation 'com.drivequant.drivekit:drivekit-stolen-vehicle-locator:$drivekit_version
}Initialization
If you have disabled the SDK auto-initialization, an initialization phase is required to use the feature included in the Stolen Vehicle Locator module. To initialize the Stolen Vehicle Locator component in your app, you must call the initialization method in the onCreate method of your Application class.
Configure UUIDs
The module scans for iBeacon proximity UUIDs.
Up to 5 UUIDs can be registered. UUIDs must be added one at a time.
UUIDs can be added or removed at any time — an active scan restarts automatically with the updated list.
Add a UUID
Registers a new UUID in the scan list.
It takes an uuid parameter in String format, and triggers a callback which is sealed class named DKAddUuidResult:
Success
UUID is valid and added to the list.
Error(val error: DKAddUuidErrorType)
UUID could not be added. See error type below.
DKAddUuidErrorType
DRIVEKIT_NOT_INITIALIZED
DriveKit has not been initialized yet.
INVALID_UUID_FORMAT
The provided UUID has an invalid format.
UUID_ALREADY_ADDED
This UUID is already in the list.
TOTAL_UUID_LIMIT_REACHED
The 5-UUID maximum has been reached.
Remove a UUID
Removes a UUID from the scan list. If the list becomes empty, scanning stops automatically.
DKRemoveUuidResult
Success
UUID is valid and removed from the list.
Error(val error: DKRemoveUuidErrorType)
UUID could not be added. See error type below.
DKRemoveUuidErrorType
DRIVEKIT_NOT_INITIALIZED
DriveKit has not been initialized yet.
INVALID_UUID_FORMAT
The provided UUID has an invalid format.
UUID_NOT_FOUND
This UUID is not in the list.
Get the UUID list
Retrieves the current list of registered UUIDs.
Returns a DKGetUuidListResult sealed class via callback:
Success(val uuids: List)
UUID list retrieved successfully. The list may be empty if no UUIDs have been registered.
Error(val error: DKGetUuidListErrorType)
List could not be retrieved. See error type below.
DKGetUuidListErrorType
DRIVEKIT_NOT_INITIALIZED
DriveKit has not been initialized yet.
Configure iBeacon search
Enable iBeacon search
Enable the search for iBeacon signals matching the registered UUID list.
DKEnableScanResult
Ssuccess
Scan successfully enabled.
Error(val error: DKEnableScanErrorType)
Scan could not be enabled. See error type below.
DKEnableScanErrorType
DRIVEKIT_NOT_INITIALIZED
DriveKit has not been initialized yet.
USER_NOT_CONNECTED
No authenticated user found.
SCAN_ALREADY_ENABLED
The scan has already been enabled.
Disable iBeacon search
Disable the search for iBeacon signals matching the registered UUID list.
DKDisableScanResult
Success
Scan successfully enabled.
Error(val error: DKDisableScanErrorType)
Scan could not be enabled. See error type below.
DKDisableScanErrorType
DRIVEKIT_NOT_INITIALIZED
DriveKit has not been initialized yet.
USER_NOT_CONNECTED
No authenticated user found.
SCAN_ALREADY_DISABLED
The scan has already been disabled.
Last updated
Was this helpful?

