[FREE] ASD Downloader Extension - Download and manage files in ASD

Yes... as already mentioned here:

Starting with Android 13, READ_EXTERNAL_STORAGE is replaced by 3 other (new) permissions, separately for images, audio and video:

  • READ_MEDIA_IMAGES
  • READ_MEDIA_AUDIO
  • READ_MEDIA_VIDEO

After Aug 31, 2023 (targetSdkVersion = 33) READ permission should be declared like this:

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
                 android:maxSdkVersion="32" />

I will also include this and other changes starting with targetSdk=33 in my guide "Some basics on Android storage".

Is it specifically for non ASD path or for ASD as well?

:ballot_box_with_check:

1 Like

Okay, so as my extension is specially for ASD then no need to declare permission in extension to manage files in ASD

Also,

I have tried to copy a file from ASD to storage/emulated/0/Download folder and it worked without READ WRITE PERMISSION.

Yes, on Android 11+, but on Android ≤ 10 storage permissions are required.
And as I said READ perm. is also required on Android 11+ for listing media files, that are not created by the app itself.

Read this guide:

This statement is also wrong, because the minSdkVersion is 7 with AI2 (Android 2.1, Eclair). On API < 19 (Android 4.4, KitKat) storage permissions are also required for the ASD.

Believe me, I've had quite a bit of experience with these "beloved" permissions for more than 10 years. :wink:

2 Likes

Thanks for your information.

Anyways most of the components requires min. Android level 5, so I believe most of the users won't face any issues using the extension to work with ASD.

No.

Then you shouldn't have provided these methods:

Not for non ASD actions, I am saying for ASD.

As I said, you must declare READ & WRITE permission in the Manifest (at least for API 7 - 18) also for ASD. So users must add a File component and enable the READ + WRITE permissions in the Designer.

2 Likes

Version 2 Updated

WHAT'S NEW

  1. Fixed file not downloading issue with some links.
  2. Renamed StopDownload to CancelDownload.
  3. Removed GetDownloadSpeed block due to internal issue.
  4. Added new method FileSize to get file size from file path.

image

1 Like

Hello, I am testing your extension and I have a problem that seems to be url dependent. I tested using your test app and also with simper example written by myself and the results are the same.

  1. Example that works: url = https://levocidiastarte.com filename: win.ico
  2. example that does not work: url = https:/levocidiastarte.com/tmp filename: win.ico
    this example does not work returning this error: Failed to download the file. Reason: placeholder

I uploaded the same files in both directories in the server, you may test with a normal browser, I did not put any read restrictions on those directories.
Do you know what means the error? And do you may explain me the different behaviour?
Thanks,
Massimo

Ok, I found the solution but in my opinion there is a problem. If my file is https://levocidiastarte.com/tmp/win.ico I have to input to ASD.DownloadFile url as https://levocidiastarte.com and as fileName tmp/win.ico and then it works. The problem is that DownloadFile saves the file in ASD/tmp (for ASD I mean the folder of the app ASD. I think that givin one more input (may be path?) could be better because the user can select the directory where download the file.

Hi,

As this extension is to download files in ASD, download file path is by default set to ASD. You can change the download location within the ASD in other folders but not outside the ASD.

If you want to save that file in other locations either you can copy the file from ASD to your preferred location after it is downloaded or use other download extension/component that allows you to set download path.

I did not explain well what I mean. If I download win.ico from https://levocidiastarte.com, so the complete file name is https://levocidiastarte.com/win.ico then the extension will download it in /win.ico
Instead if I download https://levocidiastarte/tmp/win.ico the extension will donwload it in /tmp/win.ico I would prefer that win.ico is downloaded always in /win.ico or, better, have the possibility to define a subfloder of where download win.ico
(P.S. there are missing dots or commas at the end of some phrase to do not generate misunderstandings).

Okay now I understand.

You have set wrong url and path. Try this:

Url: https://levocidiastarte/tmp/win.ico
Path: win.ico

In url set full download link of your file and path will be win.ico (filename.extension).

If you want to set a custom folder then before file name set folder name

My folder/win.ico

Hope this helps.

OK, it works it is a solution.
Just to understand: why if I put:
url: https://levocidiastarte/tmp
and
path: win.ico
it returns the error: Failed to download the file. Reason: placeholder
?

Because the url you set is not a file url, so it will gives error.

To download a file the url should be set to actual file url.

But also if I put:
url: https://levocidiastarte.com
and
path: tmp/win.ico
it works... also if url is not a file url...