Let me tell you the workflow once more.
- you open SAF picker
- user choose a document or tree
- you get the uri
- you take persistable uri permission
- you do the whatever you wanted
[quote="vknow360, post:144, topic:41603"]
When i'm using SAF picker I can read and save my doc.
But I don't want use the picker, I know the uristring, I want read the file directly.
I don't understand if you don't want help me or if you can not help me.
Ok, so you tested with the APK, true?
This is not possible, you must obtain access using ACTION_OPEN_DOCUMENT
.
So you cannot read / write from / to it directly.
In short, you can't use SAF
without using one of these blocks:
To create a new doc, the first block and the CreateDocument
(plus TakePersistableUriPermission
) block must be used. The second block must be used to read or write to an existing doc (and it seems this is also possible without PersistableUriPermission
).
I agree with you, maybe it's not possible now without OpenDocument, but I think vknow360 could implement this feature
Nope, not possible. You must use one of those picker blocks, at least once.
You can't reach to the roof without climbing stairs.
can you explain why ? with opendocument you can get permissions, you know how.
PersistableUriPermissions
apply to directories, not documents. When a doc has been opened (picked), it seems you have unrestricted access to it.
I updated my post, #138
.
If to read my text file I have to open the folder and pick the file I might as well use a file browser without making a dedicate app
If you want to do it without SAF
, the text file must either be in one of the shared
folders (/Download
or /Documents
) or in the ASD
.
No.
No, this also doesn't work with Companion on Android 11+ devices.
It did work for me in the companion, I was able to choose a file and use the URI.
You can choose a file from root folder but you can't choose root folder itself.
I don't have enough idea about it...