With Android 10 and scoped storage it's not possible to use Environment.getExternalStoragePublicDirectory()
anymore.
There are multiple other options, including MediaStore and Storage Access Framework.
Our email app would like to only append new files to Downloads collection. We must pre-process them locally so we can't use DownloadManager.
MediaStorage guide mentions
Note: Although it's possible to store general-purpose files in either the Documents/ folder or the Download/ folder—including non-media files—it's better to use the Storage Access Framework (SAF) for these use cases.
But from what I understand from Storage Access Framework guide we would have to prompt user each time when they want to download a file and it seems unnecessary.
What is the common practice for appending files to Downloads?
here is an exemple to write à file in download folder :