Extension to download file(s) to ASD (app-specific directory) without WRITE permission

Here is an extension to download any file (jpg, png, txt, apk, zip, mp3, …) to the ASD (app-specific directory) without WRITE_EXTERNAL_STORAGE permission.

Version 1 (Dec 13, 2020):
de.bodymindpowerDownloadToASD.aix (removed)
Version 2 (July 16, 2021):
DownloadToASD.aix (7.5 KB)

Version 3 (Aug 24, 2021):
Here is a special version of the extension, that does not show a notification while / after downloading.
DownloadToASD_notifHidden2.aix (7.6 KB)
Note: Use this version of the extension only if you don’t want a notification while / after downloading.

At the latest when Kodular targets API 30 (Android 11, Aug 2021), the ASD will be of outstanding importance. With this extension you can download files into this directory or subdirectories in it. With API 30 (→ targetSdkVersion=30), Google no longer allows (unrestricted) access to external storage - outside the ASD (→ Scoped Storage). See also here: Some basics on Android storage system

Kodular now uses the AndroidX libs (like AI2 is already did).

So it will soon be necessary to adjust to this and make appropriate changes and adjustments in the projects in good time.

Blocks v3

grafik

Example blocks

Version 4 (April 11, 2022), EDIT: bug fix - April 19, 2022:
de.bodymindpower.downloadToAsd.aix (16.6 KB)
Added: (1) Progess event (feature), (2) .Exists (3) .Delete

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_B.G for helping!

(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 also use the DownloadCompleted event so that 100% is displayed at the end. → See my example blocks below.

Example blocks

53 Likes
Download to "ApplicationSpecificDirectory"
How to hide my Downloaded files
How to save an offline file?
PDF files not open
Where should I store the icons used inside my app?
CSV does not save all items and problems saving the file
Some basics on Android storage system
Write / save in the Private dir (internal storage)
[Free] Fetch - A powerful and simple download tool
Exporting stuck at 100% Waiting for download link
Firebase Authentication is not secure?
[FREE] Smart MiniTools Extension V2 :⚒️ with color picker ⚒️⚙️⚙️
Extract zip without read/write permission
Error for read a text from file
How to hide folder name in user's devices in pdf application
Runtime Error ShowAlert
When AndroidX libraries will come in Kodular
Socialo: The all-in-one Social Media, Shopping and Entertainment Junction
Save image from url
How Can I Play Audio from URL and After download use Internal storage (Cache)
What is Photos and media Download permission Any one Give
How to call data from database and then save localy
Doubt Regarding Api30
The File component doesn't work
Tem como baixar arquivos para o app depois de instalado? - Is there a way to download files to the app after it's installed?
How to make a download link for pdf with notification
Can Bodymindpower give the new update for custom download
help, with web view tool
Web view download challenge
How to download files in zip format from Google Drive to /Download folder?
Get the path of → ASD (app-specific dir) & → private data dir (internal storage)
How to download sound in ASD folder
Database on csv
It is possible that after downloading a song it will show download song in next screen like youtube show?

Great extension.

2 Likes

Great Extension @bodymindpower

2 Likes

Nice Extension!
Would be better if we can avoid Download manader noptification when download finish (need option “Show Notification” like with Download component).
I uncheck Visible but do not change nothing.

1 Like

This will work for pdf ?

2 Likes

As I said (→ any file):

Why don’t you just give it a try?

3 Likes

Excellent extension. Thanks.

2 Likes

@bodymindpower Can you also add events for progress changes, Download Failed, Already Downloaded, etc…
Thanks for such a great extension…

1 Like

More features may be added later when there is time.

3 Likes

Could you please clarify if my understanding is correct?
we can use this extension for now, and it will not work once Kodular moves to AndroidX libs in another ~6 months time?

1 Like

No I think this extension is working well in app Inventor so there is no problem with kodular even if their Update

1 Like

correct, later you will have to use the App Inventor version, which already uses AndroidX
Extension to download a file to ASD without WRITE permission by BodyMindPower (for App Inventor)

there exist 2 different versions… so your assumption is wrong

Taifun

7 Likes

Thank you :slightly_smiling_face:

1 Like

How about reading the description:

2 Likes

My app… downloads a zip file that is extracted so the app uses the extracted files …

With android 11 this operation fails

What shall I do Now?

1 Like

Works fine on Android 11 (Pixel 2XL):

5 Likes

Can you please tell me what URL it will generate means file path

For ex = I want to access my file in web viewer so I need this type of URL : file:///storage…

Tried many things nothing worked! :frowning_face:

1 Like

1 Like

If any user use file manager it can find this file or not???

1 Like

you can find it in Android 10 or below
starting from Android 11 in a file manager the directory /Android/data will be displayed as “no data available”

Taifun

1 Like