I read that I have to prepare my app in advance for Android Q release because then the common read/write access to files outside the app-owned directories could be deprecated, if they do not withdraw the new way of managing those files.
I have not so many lines of codes to change, luckily.
The fact is that the Storage Access Framework seems to have some issues. And it is here from Kitkat, I see (I did not know it). Otherwise my code is wrong.
I am not able to simply make the user choose a folder on the cloud storage so to get the Uri in return, to further populate that folder.
When I use the sample code found at
and put it in a basic activity app (the example default app created by the IDE), it happens that the user cannot select a cloud storage root but only disk locations. It is in Kotlin but I translated it to Java without altering it. Is it not a Java issue because I tried also the Kotlin version.
[ I wrote other code with some hacks that at least lead to having the cloud folder Uri back in the onActivityResult method. It encompasses using a different intent Action but it still does not serve my purposes, the middleware doesn't like it so it breaks Storage Access Framework - failing to obtain document tree from uri (returned from Drive app) ]
In both cases I have the same paths:
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="filesPath" path="/"/>
<external-path name="externalPath" path="/"/>
<external-files-path name="externalFilesPath" path="/"/>
</paths>
How to have the user select a folder on the cloud provider and how to get the uri?