SDK Configuration (Android)

The first step is to configure the Android SDK.

Set Tracking in AppState

Roam.setTrackingInAppState(STATE)

Offline Location Tracking

Roam.offlineLocationTracking(Boolean)

Allow Mock Location

Roam SDKs reject Mock Locations on the device by default.

Roam.allowMockLocation(Boolean)

Accuracy Engine

To enable accuracy engine for Passive, Active, and Balanced tracking

Roam.enableAccuracyEngine()

For Custom tracking modes, you can pass the desired accuracy values in integers ranging from 1 - 150m.

Roam.enableAccuracyEngine("DESIRED-ACCURACY-VALUE")

For disabling accuracy engine

 Roam.disableAccuracyEngine()

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.

// ENABLE as Boolean (mandatory)
// TITLE as String (mandatory)
// DESCRIPTION as String (mandatory)
// ICON as String (mandatory)
// ACTIVITY_PATH as String (mandatory)
// FOREGROUND_SERVICE_PATH as String (mandatory)

Roam.setForegroundNotification(ENABLE,"TITLE","DESCRIPTION","ICON",
"ACTIVITY_PATH","FOREGROUND_SERVICE_PATH")

Last updated