In my app the user can select an existing file or just write a plain file path. Later the app uses the path to perform operations on selected file. I'm trying to study a strategy to face how filesystem access is changed in Android Q. I see two problems:
- I can't use anymore file paths or just use
File
interface but I need to use a Uri and I need persistent access to this Uri. - Uri are not "predicatable", i.e. if the file doesn't exist at the moment the user can't select anything and it can't guess what will be the Uri (right?)
For point one I could use ACTION_OPEN_DOCUMENT_TREE
with persistent read/write on the root to have access to all files, but I have no idea how to manage point two. To be noted that the file is not created by my app but it could be created later from another app and my app just use it. How can I manage point 2?