SAF: App Inventor implementation of Storage Access Framework

I agree with you, maybe it's not possible now without OpenDocument, but I think vknow360 could implement this feature

1 Like

Nope, not possible. You must use one of those picker blocks, at least once.
You can't reach to the roof without climbing stairs. :wink:

8 Likes

can you explain why ? with opendocument you can get permissions, you know how.

1 Like

PersistableUriPermissions apply to directories, not documents. When a doc has been opened (picked), it seems you have unrestricted access to it.

1 Like

I updated my post, #138.

1 Like

it runs well

1 Like

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

1 Like

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.

1 Like

3 posts were split to a new topic: How can I read/write my text file in /Documents?

Is there any way to use the main folder?
In the companion, it was fine but not in the exported APK.

1 Like

No.

No, this also doesn't work with Companion on Android 11+ devices.

3 Likes

It did work for me in the companion, I was able to choose a file and use the URI.

1 Like

You can choose a file from root folder but you can't choose root folder itself.

3 Likes

I don't have enough idea about it...

1 Like

Yes, but you asked

and the answer is (again) no.

But you can select / pick e.g. a text file from the root dir of the external storage and read / write from / to it.

3 Likes

Hi
If I don't select a document in open single document list and click the back button all the way to the root level I get this error message.

I am using the Saf_readWrite.aia sample

2 Likes

If you didn't choose a document, then uriString and uri returned will be empty.
image

If I decide not to choose a document and just want to get back to the main screen, How do I close the list without getting this error?

2 Likes

Check if uriString is empty or not before proceeding.

1 Like

Usually empty string and nothing are not the same... this is something which should be fixed in the extension

Taifun

4 Likes