SDK Configuration

Set Tracking in AppState

Kotlin
Java
1
Roam.setTrackingInAppState(STATE)
Copied!
1
Roam.setTrackingInAppState(STATE);
Copied!
Parameter
Description
STATE
RoamTrackingMode.AppState.FOREGROUND (or)
RoamTrackingMode.AppState.BACKGROUND (or)
RoamTrackingMode.AppState.ALWAYS_ON

Offline Location Tracking

Kotlin
Java
1
Roam.offlineLocationTracking(Boolean)
Copied!
1
Roam.offlineLocationTracking(Boolean);
Copied!
Parameter
Description
Boolean
true (default) -- Offline location enabled. false -- Offline location disabled.

Allow Mock Location

Roam SDKs reject Mock Locations on the device by default.
Kotlin
Java
1
Roam.allowMockLocation(Boolean)
Copied!
1
Roam.allowMockLocation(Boolean);
Copied!
Parameter
Description
Boolean
false (default) -- Mock location disabled.
true -- Mock location enabled

Accuracy Engine

To enable accuracy engine for Passive, Active, and Balanced tracking
Kotlin
Java
1
Roam.enableAccuracyEngine()
Copied!
1
Roam.enableAccuracyEngine();
Copied!
For Custom tracking modes, you can pass the desired accuracy values in integers ranging from 1 - 150m.
Kotlin
Java
1
Roam.enableAccuracyEngine("DESIRED-ACCURACY-VALUE")
Copied!
1
Roam.enableAccuracyEngine("DESIRED-ACCURACY-VALUE");
Copied!
For disabling accuracy engine
Kotlin
Java
1
Roam.disableAccuracyEngine()
Copied!
1
Roam.disableAccuracyEngine();
Copied!

Set Foreground Service Notification

Use setForegroundNotification method to notify the user about location tracking in the notification bar. Set ENABLE as true to enable notification and false to disable the notification.
Kotlin
Java
1
// ENABLE as Boolean (mandatory)
2
// TITLE as String (mandatory)
3
// DESCRIPTION as String (mandatory)
4
// ICON as String (mandatory)
5
// ACTIVITY_PATH as String (mandatory)
6
​
7
Roam.setForegroundNotification(ENABLE,"TITLE","DESCRIPTION","ICON","ACT
8
IVITY_PATH")
Copied!
1
// ENABLE as Boolean (mandatory)
2
// TITLE as String (mandatory)
3
// DESCRIPTION as String (mandatory)
4
// ICON as String (mandatory)
5
// ACTIVITY_PATH as String (mandatory)
6
​
7
Roam.setForegroundNotification(ENABLE,"TITLE","DESCRIPTION","ICON","ACT
8
IVITY_PATH");
Copied!