7. Permissions

To do proper detections, the Sentiance SDK requires a few permissions to be granted by the user at application runtime. The SDK does not ask for these permissions itself. Instead, after explaining to the user why you need each permission, you must present the permission dialogs as part of your application's flow.

An example implementation of a permission dialog is available in our Github app.

Location

When running the SDK on Android 6 and above, it is required to ask the user for the location permission. Additionally, if your build targets API level 29 and above, it is also required to ask for the background location access permission.

The SDK automatically adds the ACCESS_FINE_LOCATION permission to your app's manifest, however it does not add the ACCESS_BACKGROUND_LOCATION permission (see here). Instead, you must explicitly add it to your app as follows:

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

If any of these permissions is not granted, SdkStatus.isLocationPermGranted will be false.

Activity Recognition (Android 10+)

When targeting API level 29 and above, it is required to ask the user for the activity recognition permission. This permission grants access to the user's physical activity data (idle, walking, etc.).

The SDK does not add the android.permission.ACTIVITY_RECOGNITION permission to your app's manifest (see here). Instead, you must explicitly add it to your app as follows:

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

When this permission is not granted, the SdkStatus.isActivityRecognitionPermGranted will be false.

Last updated