Try setting initialDir
to content://com.android.externalstorage.documents/document/primary%3AMyFolder%2F
When you choose a dir with SAF Picker you will find tree
in place of document
.
1 Like
patel
August 15, 2022, 5:29am
267
I tried with this block, it runs well, but how can I select the file ?
Anke
August 15, 2022, 8:59am
268
By clicking on it. (How else?)
patel
August 15, 2022, 9:12am
269
How can I get the selected file uristring ? With OpenDocumentTree block I get the uristring of selected folder, not the uristring of selected file-
patel
August 15, 2022, 3:32pm
271
I know the folder, I know the filename , is it possible to open it with only one pick ?
It is possible and a work of adding just one line. Its implementation will take few days.
patel
August 15, 2022, 4:09pm
273
OK, thank you, I realized that using OpenDocumentTree block and clicking as attached you can view the file content.
You can try this beta version:
com.sunny.saf.aix (31.4 KB)
1 Like
patel
August 16, 2022, 4:19pm
275
OK, it runs well, thank you for your help.
patel
August 17, 2022, 7:25am
276
Can you explain me the difference betwen type and extraMimeTypes ? can I use them for showing my desired file only ?
patel
August 17, 2022, 10:22am
278
I mean all filenames starting with P
Anke
August 17, 2022, 10:43am
279
Then you have to list all files first and check then which of them start with "P".
patel
August 19, 2022, 8:19am
280
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 ?
Anke
August 27, 2022, 9:43am
282
@Alexandre_Gorine has confirmed (via PM) that this aix (v1.2beta) works for him:
com.sunny.saf.aix (32.6 KB)
What's new
Fixed ReadAsByteArray method
Added CopyDocumentToASD method
He is also the sponsor of above features. Thank you.
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
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:
UPDATE (version 3): Download with progress feature
A progress feature has been added. The progress can now be displayed in bytes / MB and as a percentage during the download. Thanks to @Kumaraswamy who is "light years" ahead of me with Java.
de.bodymindpower.downloadToAsd.aix (15.2 KB)
(created using Rush - thank you again for this great tool @shreyash )
Note: The DownloadProgress event doesn't seem to complete, but it does (it just doesn't show up in time). Therefore, you should alβ¦
However, Download is an Android shared folder, you do not need SAF to access it.
From an Android point of view there are an β Internal Storage and an β External Storage .
1. Internal Storage
The Internal Storage can only be accessed with a rooted device.
1.1 The app package is saved in
/data/data/<packageName>/
In order to be able to debug your app, AI2 saves the assets for β Companion on devices with
Android β₯ 10 (API β₯ 29):
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/
Android < 10 :
/storage/emulated/0/Android/data/edu.mitβ¦