0

I have updated my app to API level 29 so it broke my image picking mechanism. Eariler everything was working fine. Now when I searched over forums/stackoverflow I came to know that I have to migrate to scoped storage framework in order to make it work. I found 2 things so far

  1. opt out of scoped storage
  2. Read the stream and write into cache directory so that my app can access it.

My question is that is it mandatory to copy the file for using it. If yes I'm afriad to use this approach as it will consume lot of time because my app uses large videos which we upload to server.

Is it possible to use this framework to just read the URI of image/video without copying to cache directory ? Did anyone worked on it ?

for reference I followed these articles

  1. https://developer.android.com/guide/topics/providers/document-provider
  2. https://medium.com/@sriramaripirala/android-10-open-failed-eacces-permission-denied-da8b630a89df
  3. https://issuetracker.google.com/issues/130494105
Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • We're also facing the same issue. Let me know when you found a fix – Rahul Vyas Aug 07 '20 at 12:46
  • "my app uses large videos which we upload to server" -- use the `Uri` itself to do the upload: https://stackoverflow.com/a/56308643/115145 – CommonsWare Aug 07 '20 at 13:14
  • @CommonsWare We're using AWS S3 TransferUtility. Also the issue only appears on API level 29 and Android 10 devices. – Rahul Vyas Aug 07 '20 at 13:45
  • "We're using AWS S3 TransferUtility" -- then ideally they would update their API to support `Uri` or `InputStream`. You may need to just opt out of scoped storage for Android 10, and `READ_EXTERNAL_STORAGE` mostly works normally on Android 11. – CommonsWare Aug 07 '20 at 13:53

0 Answers0