Android Question GetSafeDirDefaultExternal and manifest question

Scantech

Well-Known Member
Licensed User
Longtime User
B4X:
AddManifestText(
<uses-permission
  android:name="android.permission.WRITE_EXTERNAL_STORAGE"
  android:maxSdkVersion="19" />
)

My app manifest is android:minSdkVersion="21" and I am using GetSafeDirDefaultExternal.

Do I really need the above code in my manifest?
 

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
Yes, you need it: The explanation for this is that GetSafeDirDefaultExternal doesn't require any permission on Android 4.4+ (API 19) and requires the WRITE_EXTERNAL_STORAGE on older versions. The code above adds the permission to older devices.
 
Upvote 0
Top