I'm using Activity Starter to store images, and I'm running into a couple of issues. Is there any way to get the "Ask Permissions" popup to show every time the user clicks a button, up until they finally give permission?
Currently, they'll only be asked twice, and then even after closing the app and granting the necessary permissions, nothing happens - rather, the old message, "Error 908: The permission WRITE_EXTERNAL_STORAGE has been denied. Please enable it in the Settings app", pops up every time the "Add Image" button is pressed. The idea is that the user shouldn't be able to select an image unless WRITE permission has been granted.
1 If your Android version is 11 or later, there is no such permission as WriteExternalStorage, so it will never be granted.
2 in your blocks, 'Permission Write External Storage ' will never be equal to true.
Hmm... So how would I ask for permission? The app stops working when I try to display images I've saved via Activity Starter, but it displays them once I turn on the media permissions.
I would like to clarify this a bit:
If WRITE permission is declared in the Manifest (DefaultFileScope = Legacy) and WRITE is requested on Android 11+, the PermissionGranted event returns (incorrectly) WRITE_EXTERNAL_STORGE. However, this permission no longer exists on Android 11+, which means that instead of WRITE permission, only READ permission is granted.
READ permission exists on all Android version and you have access to all media files in all locations of the external storage on all Android versions. See also my overview here.
To make it short: WRITE permission always implicitly grants READ permission. However, since WRITE permission is no longer available there, onlyREAD is granted on Android 11+.
Image Picker only allows you to save 10 images. I tried using TinyDB to somehow overcome this, but that doesn't work. Activity Starter was suggested as an alternative, but it requires permissions.
Thanks! The issue is, if permissions are turned off after images have been saved, when I go to view them through the app, the app crashes. It will keep crashing until I turn the permissions back on. While I myself know what the problem and fix would be, my users probably won't, so this constant crashing will just make the app look unstable.
I'm also concerned about this message that I get when I go to turn on permissions: "This app doesn't support the latest version of Android. If this app can access photos and videos, it will also be allowed to access music and audio files."
Does this have something to do with using Activity Starter?
If there is a way to save more than 10 images using ImagePicker, thus overriding the Write/Read requirement, I'd much prefer this, as Activity Starter needs permissions, and I'd rather not have to ask for them.
Sorry, what I mean is that the ImagePicker doesn't ask for permissions, so I'd prefer to use that for choosing images. Is there a way to save more than 10 (the limit says 10)? I tried saving them to TinyDB, but they still get overwritten. Would moving (and renaming) the file using Taifun's file manager extension, then saving it to TinyDB work?