Android SDK required permissions.
CompletedAccording to the comment in sample code here https://developer.dji.com/mobile-sdk/documentation/android-tutorials/ImportAndActivateSDKInAndroidStudio.html - we need to request all of the permissions listed. I don't want to ask the user for any permissions they don't need. How can I know exactly what each permission is required for, so our users can only grant permissions they absolutely need? For example, if they deny Manifest.permission.READ_PHONE_STATE, what are the repercussions?
// When the compile and target version is higher than 22, please request the following permission at runtime to ensure the SDK works correctly.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.VIBRATE,
Manifest.permission.INTERNET, Manifest.permission.ACCESS_WIFI_STATE,
Manifest.permission.WAKE_LOCK, Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.CHANGE_WIFI_STATE, Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS,
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.SYSTEM_ALERT_WINDOW,
Manifest.permission.READ_PHONE_STATE,
}
, 1);
}
Thanks,
-
Dear Client Thank you for contacting DJI. The documentation is out of date, you can just stick the permissions we have listed in our Sample. Some of the SDK command requires the Android phone permissions such as RECORD_AUDIO allows you to record the voice and upload to the onboard speaker. If you don't want to use this function, I am sure you can delete this permission requirement. For READ_PHONE_STATE, I would guess it may refer to the phone's location. Because our RC does not have a GPS module in it anymore, so we will use the phone location to represetns the RC location. ![](https://djisdksupport.zendesk.com/attachments/token/jh0cw64HoKvvYgc9MnRrUl44T/?name=image.png) Link:https://github.com/dji-sdk/Mobile-SDK-Android/blob/master/Sample%20Code/app/src/main/AndroidManifest.xml Kindly Regards, DJI Developer Support
Please sign in to leave a comment.
Comments
1 comment