Android Question Save image to gallery - targetSdkVersion=30


Well-Known Member
Licensed User
Longtime User
Hello my friends,

According to this:
- 29 - No permission to access File.DirRootExternal, even with the STORAGE permission. For now there is a simple workaround:
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
Note that you need to reference android.jar from android-29 folder.
It will not work with targetSdkVersion=30. Avoid using File.DirRootExternal. Either use File.DirInternal or RuntimePermissions.GetSafeDirDefaultExternal.

So if i want to comply with android-30 there is nothing to do so my images taken with camera2 demo project to be stored at gallery. Ιs there any workaround even if an image is stored at File.DirInternal or RuntimePermissions.GetSafeDirDefaultExternal to be shown at gallery and not only through file explorer.

[EDIT]Can this code adopted to b4a?
Last edited:


B4X founder
Staff member
Licensed User
Longtime User
Upvote 0