How to access non-media & media files on Android 11+

Thanks. It was quite helpful. I got the data inside the file, so it works also for me. But, what I dodn't is to prompt to choose the file, because the file is going to be always at the same path ( Documents/data/registro.txt. Any way to get the URI from a fixed path?

save the uri in tinydb. and also you need to request to remember the reading permission (there is a relative block).

For what reason or for what purpose?

What I want is not to choose the file, because i know it is going to be at the same place. /Documents/data/registro.txt . I don't understand how tinydb can help....

I tried with this code to avoid the prompt window to choose the file, because i need that it happens automatically...

but it seems that ContenUri that FileTools1 give is nothing to do with URI that uses SAF.

But i need a similar structures for my program that could work. Any idea?

Anke! Any way to avoid Document Picker? Can I have read that it isn't possible beacause of permissions that user give to the file when picking? I'm struggling whith.... Thanks anyway!

No, you must use one of these two blocks for SAF to work:

grafik

Thanks Anke!. Now the only way is to declare the MANAGE_EXTERNAL_STORAGE. I'm going to learn how it works.

for only use Open Single Document block once. next time no need again.

3 Likes

:ok_hand: