For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android

Platform

Android 7.0 (API Level 24) or Higher

This is the minimum supported Android version. If you support an older Android version, you can still include the Sentiance SDK, however, detections will not run.

If you face any build issues, check out this troubleshooting guide.

Google Play Services

The Sentiance SDK relies on several Google Play Services features, such as Fused Location and Geofencing.


Permissions

Location

To collection location data in the background, the SDK requires the background location access permission. This is shown as "Allow all the time" in the permission dialog.

The SDK automatically adds the ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions to your app's manifest, however you must add the ACCESS_BACKGROUND_LOCATION permission yourself.

AndroidManifest.xml
<manifest...>
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION">
    ...

Activity Recognition

To get notified of activity updates (e.g. walking, running), the SDK requires the activity recognition permission.

This permission is optional

When granted, this permission helps improve the quality of the detections. Therefore, it is highly recommended to ask the user to grant this permission.

Foreground Service (auto-granted)

Apps targeting API level 28 and above must have the FOREGROUND_SERVICE permission specified in the application manifest file.

The Sentiance SDK automatically adds this permission to your app's manifest, and specifies the service types location and shortService.

Wake Locks (auto-granted)

To collect sensor data in the background (e.g. accelerometer and gyroscope data), the Sentiance SDK makes use of Android WakeLocks to temporarily prevent the device from sleeping.

WakeLocks are held only when necessary, for example, while the user is on the move.

For the complete list of Manifest permissions added by the SDK, see this page.


Runtime

Google Play Services - Geofence Usage Limits

The Sentiance SDK uses the Geofence feature provided by Google Play Services. There is currently a per-app limit of 100 geofences, and a total of 5 PendingIntents that can be set at any point in time. This limit is enforced by Google Play Services.

For proper operation and detections, please ensure that the Sentiance SDK can set 2 geofences, and can consume 1 PendingIntent, at any given time.


Get started by including the SDK.

Last updated