SAF: App Inventor implementation of Storage Access Framework

Sure, here it is:

Also data gets kind of binded to the app and you don't lose access to it even after multiple reboots.

5 Likes

Epic work :star_struck: :+1:

5 Likes

Thank you..:+1:

3 Likes

What is the syntax for setting an initialDir?
image

Whatever I put in here, I am just taken to the last location I selected in the document picker ?

Ah, i just tried a full uri and this worked, e.g.

content://com.android.externalstorage.documents/tree/primary%3A/document/primary%3AMusic

opened at the Music folder

will this part be the same on all devices:

content://com.android.externalstorage.documents/tree/primary%3A/document/primary%3A

If I select the ASD I get a different path:

content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fdata%2Fedu.mit.appinventor.aicompanion3%2Ffiles/document/primary%3AAndroid%2Fdata%2Fedu.mit.appinventor.aicompanion3%2Ffiles

this is all using the companion...

5 Likes

Yes, it doesn't matter whether there is an empty string or a special path there.

4 Likes

... and you cannot select

  1. the root dir of the external storage /storage/emulated/0 and
  2. /Download

But you can select /Downloads.

4 Likes

If anyone want to create a
empty folder after selecting the in "open Document Tree" by using "create document" .
then mimetype is following
....
vnd.android.document/directory

3 Likes

This

image

doesn't work

This returns the root dir (/storage/emulated/0) equivalent

2 Likes

I was also hoping that these blocks would return a list of just files, but it also returns directories. I must be missing something? (I also tried around the other way using the IsTreeUri block, but that also returns files and directories)...

2 Likes

As I said,

But you cannot select this path / dir.

2 Likes

You should use GetMimeType block there.

2 Likes

Great, these blocks return the directories:

using a not block on the mimetype test should return files only :+1:

2 Likes

Well you needn't type dir mime type there.
Please check properties.

2 Likes

Yes :upside_down_face:

image

4 Likes
4 Likes

I can't say how long you can access it, but you still can access /Android subdirs.

5 Likes

Now Open Source :grin:

12 Likes

@vknow360 Nice Extension please add event Zip success and failed
Thank You

2 Likes

Sorry, for what?

4 Likes

@vknow360 Given that you commented on the corresponding thread on GitHub, would you consider implementing this as part of a core component?

13 Likes