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

Before this morning, there was still DownloadToASD, and it didn't work.

Now:
The image shows the entire code for screen 1.
The extensions include ASDDownloader only.

The app starts, but apparently the file has not been downloaded, or is not in the right place, because in the visit screen, I do not have the markers corresponding to the data of the .csv file supposed to be downloaded.

A preview of the visite screen:

This extension will download the file in ASD.

So you need to specify the full file path from ASD to read it.

With the DownloadToASD extension, I didn't need to enter the full path.
Does the full path change from one smartphone to another?
If so, it will be complicated to install it on different smartphones.

In screen1 use the DownloadCompleted event to find out if the download was successful

In screen visite in the File.GotText event display the text in a label as test and deactivate all other blocks

You do not need a full path to read a file from ASD

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

I followed almost all of your instructions, only making changes to screen 1 to begin with, and with that alone, it works:

Thank you very much.

1 Like

The extension works like a charm, but I want to know how to create a folder inside the Documents folder. In the MFile extension, when I use the block Create Directory with the path file:///storage/emulated/0/Documents/123, it successfully creates the 123 folder inside Documents.
However, when I use your extension and call the Create Folder block with either "file:///storage/emulated/0/Documents/123" or "/storage/emulated/0/Documents/123", it doesn't create the folder.
What is the best approach to achieve this?

According to the documentation

you can't use this extension to create a folder in shared storage, only in ASD

Just use the MFile extension then
Read the documentations and use the corresponding extensions accordingly

Taifun

1 Like

That's correct, create folder will creates new folder in the ASD directory.

May be I will update it later to create in a specified path.

1 Like

Isn't whole idea to provide an extension that downloads files to the ASD ? :wink:

Developers can always move it to a shared directory if they need to.

Yes it is, but it will expand the usability of the function.


image
Im getting "Invalid value for visibility:2" error when downloading my google spreadsheet in .csv

Follow this.

Also the file name should contain file extension ex. test.csv

Visibility is controlled by the . Visible attribute.

Where do you change that?

Here visibility referred to ShowNotification property which is by default set to false.

Since companion doesn't have android.permission.DOWNLOAD_WITHOUT_NOTIFICATIO permission it will throw runtime error.

To avoid this while testing is companion it is advised to enable show notification so that the runtime error will not throw. In Apk it will not cause any issue.

Shortly after releasing your extension, I gave you several hints regarding required storage permissions. However, I just noticed that your extension doesn't declare any storage permissions at all. :upside_down_face: :woman_shrugging:

There are at least 16 methods that definitely require storage permissions. And on Android under 4.4 (KitKat, API 19), storage permissions are required in every case (including for the ASD).

1 Like