0

I have a file transfer app that needs to save the files it received in the Download folder. On Android >= 10, MediaStore makes this extremely easy, since it provides a direct method for creating entries in the download folder, without any special permission.

However, on Android < 10, the download URI is not avaiable in the MediaStore API, and I have to rely on the old method for saving files, which requires the WRITE_EXTERNAL_STORAGE permission with consequent popup for asking it.

Is there any way around this? Maybe some kind of support library that brings the Download URI back to older versions of Android?

MichiBros
  • 113
  • 1
  • 7
  • I don't think there's a way around it, i.e: without asking for permission from the user. Also, check this answer: https://stackoverflow.com/a/28183933/1135866 – VCODE Feb 17 '23 at 21:19
  • `However, on Android < 10, the download URI is not avaiable in the MediaStore API,` ? Which uri? What do you mean? Where are you talking about? – blackapps Feb 17 '23 at 22:22
  • The entire MediaStore.Downloads class was added only in API 29. Check this out: https://developer.android.com/reference/android/provider/MediaStore.Downloads – MichiBros Feb 17 '23 at 22:32

0 Answers0