SDK Configuration (Android)

The first step is to configure the Android SDK.

Set Tracking in AppState

Roam.setTrackingInAppState(STATE)

Parameter

Description

STATE

RoamTrackingMode.AppState.FOREGROUND (or)

RoamTrackingMode.AppState.BACKGROUND (or)

RoamTrackingMode.AppState.ALWAYS_ON

Offline Location Tracking

Roam.offlineLocationTracking(Boolean)

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.

Roam.allowMockLocation(Boolean)

Parameter

Description

Boolean

false (default) -- Mock location disabled.

true -- Mock location enabled

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