10

I've been upgrading my project to SDK 33.

I changed the permissions where I needed to access media files, such as photos, with the new permission READ_MEDIA_IMAGES and it is working fine.

But I need to access documents such as PDF files in order to upload them to the server, but I cannot find any information concerning android 13 and documents.

Before the upgrade I had READ_EXTERNAL_STORAGE permission and I accessed all the files.

In the andorid documentation on the link below, only these three permissions are provided READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO instead of using READ_EXTERNAL_STORAGE.

https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions

Any ideas on how to fix this and what steps to follow?

Dipsy
  • 141
  • 1
  • 1
  • 7
  • You can either choose PhotoPicker or go with the granular permission approach https://codewithninad.com/accessing-android-storage-on-android-13-above – N-JOY Aug 14 '23 at 08:21

1 Answers1

9

According to Google storage documentation. It seems that for non-media files no permission is needed. https://developer.android.com/training/data-storage.

  • Thank you, this one saved me. Another thing I wonder, using the system file picker I can still upload media files from there, is it okay if I leave it like that so users can upload either images or pdfs, or I must divide the file picker from the image picker? – Dipsy Sep 01 '22 at 08:28
  • I was fighting against the permission for a PDF my app generated -.- Thanks! – ieselisra Apr 25 '23 at 20:52