Permission Handling
Description of required permissions, how to request and manage them.
Last updated
Description of required permissions, how to request and manage them.
Last updated
The library requires at least the following permissions to access Move services.
Depending on the used services, different permissions are required. The following table gives an overview what's required:
Required permissions
Optional permissions
Mode of Transport
Driving
Bicycle
Walking
Driving Services
Distraction-Free-Driving (DFD)
Driving behaviour events (DBE)
Other services
Points of Interest
is not mandatory, but strongly recommended. Similarly for the optional Activity Recognition permission (Driving) - make sure to request this from the user, otherwise it will degrade the quality of the service.
More Information regarding the system permissions can be found here:
The required permissions must be granted before the services can be used. If any single required permission is missing, the entire SDK stops working. In case of any permission error, the SDKState callback will be triggered with an error state:
If there are permissions missing, the state is an object of type MoveSdkState.Error. The error state contains an error reason which can be any of the following:
Overlay (ErrorReason.PermissionMissing.Overlay)
Location (ErrorReason.PermissionMissing.Location)
Phone (ErrorReason.PermissionMissing.Phone)
Activity (ErrorReason.PermissionMissing.Motion) (since Android 10 )
Starting with Android 11, the user will only be taken to the settings overview screen, and the user needs to select the specific app itself.
Since Android 10 there is an additional background location which should be also requested when asking for location permission. In Android 11 the user must go to the location settings of the app to grant the "Allow all the time" permission.
The following shows an example which is used in our demo app.
- improves trip recognition and classification considerably
,
,
The PermissionMissing error reason contains a string pertaining to the relevant permission of the Android Manifest, e.g. Manifest.permission.READ_PHONE_STATE. This permission string can be used to request dangerous permission directly as shown in the code example below. For more information about dangerous visit the .
In fact the SDK is not aware of permission changes, the developer can tell the SDK that the error is resolved. This can be done for example in .
In Android there are some which require a request during runtime. Keep in mind that those need to be defined in the manifest as well. Before init of the MOVE SDK, the proper permissions should have been already requested.
The overlay permission () ,which is required for distraction free driving, needs to be requested in a specific way. The user is lead to the app settings where the permission needs to be enabled.