SAF: App Inventor implementation of Storage Access Framework

Here you need to build child document’s uri using BuildChildDocumentsUriUsingTree method.

1 Like

i tried to place the block as told, source uri remain same which i initially entered
still not working?


here tree uri is
content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fmedia%2Fcom.whatsapp%2FWhatsApp%2FMedia%2FWhatsApp%20Documents

here target parent uri is
content://com.android.externalstorage.documents/tree/primary%3AAndroid%2Fdata%2Fio.makeroid.companion%2Ffiles

Do you have write access to this?
However your blocks are still wrong. I’ll post the blocks as soon as possible.

1 Like

yes read and write access are given to the whatsapp document folder

Unfortunately, it is not possible currently to copy files from /Android/media folder with SAF, but you can expect something from v1.1 .
However you can copy files manually also, by reading and writing its content.
Also you can use file manager extensions to copy files. @bodymindpower

4 Likes

Of course its possible. You can use your FileTools or the TaifunFile extension or the File component for that (and of course you need READ permission for this).

3 Likes

I have tried all three options
TaifunFile
FileTools
File Component
I am using android 11
Error are coming, please suggest me if i am doing mistake
blocks(36)



blocks(39)


Error are in sequence that is TaifunFile then fileTools then file component.
source name in all is
/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Documents/LastFile.bjn
destination name in all is
/storage/emulated/0/Android/data/com.try23/files/LastFile.bjn
Suggestions requested please
try23(1).aia (64.1 KB)

Have a look here:

So now you just need to get byte array from the file and write it wherever you have access.

I said you can copy file from /Android/media/, but there might be some special sub-folders like yours /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/WhatsApp Documents/ that only certain apps (like WhatsApp) can access.

I created the subfolder /whatsapp manually, because (as I said) I never used Whatsapp (and will NEVER do).

blocks(2)
Try this, it will work for sure

1 Like

I have understood the concept
The file which i am coping from whatsapp document folder is a zip file i hope your concept to get byte array will able to read and write in the file in ASD ?
I will myself also check
BTW thank you all for your prompt replies
Thanks @Taifun
Thanks @vknow360
Thanks @bodymindpower
Thanks @Yash_Agarwal

2 Likes

I tried it on a device of one of my children (who sadly uses WhatsApp :sob:) and it is true that it is not possible to access these (specific) WhatsApp folders (files in these folders). Obviously, this is only possible for the WhatsApp app.

1 Like

Seems doubtful but worthy a try.

With SAF it is possible. :grin:

4 Likes

Yeah right, it should work with SAF.
I’ll check it out quickly.

1 Like

Yes, I was able to access these folders via SAF, list the files there and delete a file.
Tested on Android 10.

2 Likes

This post was flagged by the community and is temporarily hidden.

I Tried many times but it’s not work

Why the storage link should start from content://android.provider
I am unable to get this type of link with my file manager only it provides
/storage/emulated/0/Download/Recycler View%20Extension.aix
Unable to access link storage like content://android.provider
Please anyone help

Ever worked with Content URIs?

After using OpenDocumentTree or OpenSingleDocument, how to quit/stop this action and get back to companion? when i press BACK button, the companion will just quit…