0

everyone.

It is well known what a big blow Google inflicted on devs by making "Scoped storage" mandatory. After my app update got rejected by Google Play Console team for using a "sensitive permission" which my app is not eligable for (according to google), I have been struggling to make the necessary code changes and preserve my app functionallity to it's best, without removing any of it's functionallity.

My question is: Is it still possible to pick an image from the gallery, crop it (with pick and crop intents) and save it to a file, without using the "MANAGE_EXTERNAL_STORAGE" permission and how?

For reference, please take a look at an old question I posted a few years back. Does anyone know of a working method after Android 11 without the external storage manager permission or do I have to disable this function for newer versions?

I have already tried quite a few things with no success. There is also not much information online for this type of operation yet.

1 Answers1

1

Have the same problem, but i dont need to crop images (but as i see - it will work with that after you get uri). The best way to work with images (if you need just images or video) since Android 11 - is Photo Picker (https://developer.android.com/training/data-storage/shared/photopicker#handle_the_photo_picker_results) It doesnt need any kind of permissions.

Alexander
  • 536
  • 4
  • 6
  • 1
    Thanks. I will give it a try at some point and let you know if I had any success. – Теодор Митев Sep 27 '22 at 10:01
  • 1
    I can't seem to implement this with Java. More specifically `.setMediaType()` is the problem. It says the provided media type is `ImageOnly` while `VisualMediaType` is expected. The code is copied exactly as it is in the documentation. Any ideas? – Теодор Митев Oct 11 '22 at 12:35
  • 1
    Nevermind, I found a solution and it works fine. If you want to implement it on Java, you can check `ganjaam`'s answer here: [stackoverflow question](https://stackoverflow.com/questions/5309190/android-pick-images-from-gallery). And use `galleryActivityLauncher.launch(new String[]{"image/*"});` instead. Thanks for the help. – Теодор Митев Oct 11 '22 at 13:42