SAF: App Inventor implementation of Storage Access Framework

I mean all filenames starting with P

Then you have to list all files first and check then which of them start with "P".

I need to pick file or folder for opening, after picking I get automatically write/read permissions, why there are permission blocks ? When I need to use them ?

grafik

Is there a reason why this is not available in your latest extension version? @vknow360

Sorry, I forgot to add that method.
v1.2beta :
com.sunny.saf.aix (33.4 KB)

1 Like

:+1:

Firstly, why is the file in the Download folder? Does it have to be downloaded from the cloud? If so, you can download it directly to the App's ASD folder:

However, Download is an Android shared folder, you do not need SAF to access it.

After getting the URI, copy the document to the Shared folder /Documents or the ASD and then access and upload this file from there with the real (absolute or full) path.

See also here:

Goodday,Have created a read file block successfully which read the file as bytearray.

I can read the result into a label block

How to read it like array in for loop with indexing

Thanking you

Sorry, please elaborate.

Good day Sir,

Using SAF I read a binary file which contains numeric value as byte array

Using after read block I read the result into label and display the values, I can see the read values

Now i want to read directly from result (byte array) to a textbox one byte at a time in a while or for loop, how can I achieve it.

I tried to read the byte array to list but it says bad argument.

Hope I had explained my problem. I am replying through my phone, no access to my PC.

Thanking You for reply

Hi @vknow360 & All,
Writing my app to read text LOG.adi file (https://adif.org).
Now : how to convince Android to let SAF extenstion choose it for open using OpenSingleDocument ?
If I set AdiType to "text/*" and rename file to LOG.txt Android allows me to choose this file (it works fine) and other files (e.g. log.adi) are grayed-out and not available for selection.

What shall I set Aditype to to get Android allow me to chose only files with .adi extension ?

17 posts were split to a new topic: Companion issues if using extensions (on Android 13)

Dear Sunny @vknow360,
I use yr extension and it is great. Now I need to write my extension to process bytes read returned as result from GotReadResult after call to ReadBytesAsByteArray - the question is : what type is the result ?
Is it List result ? basically my intetion was to parse char[] result but I do not know where my error is ?
regards Kuba

SAF is open source, Why not check by yourself?

It returns byte[] as object.

1 Like

Dear @Kevinkun ,
could you show me how to declare Simplefunction (method) for my TEST extension that can directly take this result as byte[] . I can not "unwrap" that array from object :frowning:
Regards, Kuba
P.S. Yes, I've been looking into your code.

SAF How do you Create a Folder?

I would like to create a folder in Documents using SAF. I would like to do this to keep my different application's .csv files in organized locations. On the page dedicated to SAF " SAF: App Inventor implementation of Storage Access Framework"

@Narender_Kumar Narender_Kumar posted this statement:

"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

There must be a little more to it. I have no problem using SAF now to save, copy, delete documents. But I still cannot create a folder.
Here is what I have tried.

The directory is the Documents folder.

But no clue how to create a directory.
Here is what I have tried.


I am not really sure what else to try, but this does not create a folder for me! Any ideas?

Thanks,
Jon