In Android OS 10, how to get all the files in the Download folder?

Viewed 156

I am working with a Raspberry Pi along with an Android device. The Pi hardware dumps some files in the Download folder of the external storage of the Android device (using MTP). The path is: /storage/emulated/0/Download

I developed an app that reads all the files in this folder dumped by the Pi (having a pre-decided prefix in their name) and processes them. My app works fine for devices running on Android OS 9 and below.

Starting Android 10, and the compulsion to use SAF (aka storage access framework) by next year, I want to upgrade my solution to make it future-proof. Although there are far too many questions and answers on SO around this topic, I haven't been able to find the right solution that fits my requirement.

So here is really what I'm trying to ask: Is it safe to assume that the path mentioned above (/storage/emulated/0/Download) will be available to the Pi to dump the files in a device running Android 10? If yes, please suggest a way to read all the files present in that path in Android 10, programmatically? If no, kindly suggest an alternate way to achieve this entire process?

0 Answers
Related