[DISCONTINUED] Extension to download a file to ASD (app-specific directory) without WRITE permission


I have those.I skipped the global count because player will download it only once

I believe you are missing a / in your code

1 Like

Thanks for this wonderful extension.
One question:
every time when downloadcompleted, this message will show up, telling me some file is downloaded.
Howe to disable this?

I didn't get that message as you can see here.
(please translate the message)

OK no problem. Maybe its only on some devices.

or is it because this?

Hi!

So, can anything be done about the "file downloaded" notification?

Does that mean you don't want the notification to appear?

Yes. It also makes a sound.

Try this version of my extension:

Note: You have to add this line to the Manifest:

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
2 Likes

The app doesn't build with this extension :neutral_face:

In other news, here is an extension that just adds the permission in the manifest.

tsf.download-without-notification-permission.aix (3.9 KB)

I imported this version of the my extension (DownloadToASD_notifHidden.aix) from Kodular to AI2, built the APK (no issues!) and add this line in the Manifest:

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

I tested it on an Android 11 device:
It works and no notification apears.
So check it on your device.

1 Like

@anonwins This permission is now declared in the Manifest:

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

with the new version of my extension:
DownloadToASD_notifHidden2.aix (7.6 KB)

Note: Use this version of the extension only if you don't want a notification while / after downloading.

1 Like

I imported the extension in another project and it works indeed. So I guess there's some kind of incompatibility with the extensions in the project. I'll check more into it

Which extensions?

It turns out it's the Taifun Package Manager extension. They don't build together.

Anyway, I now use PkgUtils instead of TaifunPM, as it can do the same and much more.

Thank you @Anke and @everyone

1 Like

Works great in built apk, but in the companion it gives execution error:
Screenshot 2021-08-27 at 06-01-41 MIT App Inventor
Perhaps you could bypass it if we are in companion environment? If it's easy, which I think might be. Thank you :slight_smile:

I believe the error occurs because the DOWNLOAD_WITHOUT_NOTIFICATION permission doesn't exist in the companion app.

Yes, exactly.

Hi again,

I noticed that the file downloading doesn't stop, even if we close the app (and from android settings > force close). This, while it's great, sometimes is unwanted. Can anything be done about it?

If the file is big enough, it can eat up the user's mobile data credit.

I think of two possible ways (though I have no idea how things work):

  • provide a stopDownload block
  • when the download is requested, don't detach it from the app, or attach it to the app

Thanks :slight_smile:
Fotios Tisfo TSF Anonwins

edit: I managed to cancel the download (by sending a request to the server :rofl:) but I see there is an automatic retry after ~40 seconds.. Perhaps we would be able to modify this instead? Thanks again

Hi Anke,

great extension. Works very well with one exception...
On the first screen of my app I've added the extension 2 times:

  • during screen innitialize I've added it as "dl_pliki_csv" to download some CSV file updates
  • after button click I've added it as "dl_app" to download the updated APK file

There is a .DownloadCompleted event for "dl_app", but it is triggered on screen innitialize (as it would be an event for "dl_pliki_csv". I'm uploading the relevant blocks.

PS: as a functionality, you could add a true/false file overwrite function.

With only one extension dragged into the designer:

grafik