SAF: App Inventor implementation of Storage Access Framework

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

The error is from FileTools extension, so yeah needs to be fixed.

1 Like

Okay thank you.

I put in some blocks to check for urlString empty.
Seems to work...

2 Likes