ASD Downloader
An extension for MIT App Inventor 2.ASD Downloader extension to download and manage files in ASD (App Specific Directory). Developed by The K Studio.
ASD Downloader extension to download files in App Specific Directory (ASD) without READ or WRITE PERMISSION. Since ASD is always accessible to READ and WRITE files within the app starting Android 4.4 and it does not requires READ and WRITE permission.
Nowadays due to new restrictions in higher Android versions it is difficult to manage files without READ and WRITE PERMISSIONS where ASD is very useful to store downloaded files and manage them without any permission. Android version below 4.4 requires READ and WRITE Permission to download in ASD.
This extension allows you downloading files in ASD and managing them with various functions.
You can either show download system notification or you can hide it using this extension, also you can create a custom notification layout.
 Specifications
 Specifications
 Size: 22.00 KB
 Size: 22.00 KB
 Minimum API Level: 7
 Minimum API Level: 7
 Updated On: 2025-01-22T18:30:00Z
 Updated On: 2025-01-22T18:30:00Z
 Built & documented using: FAST-CLI
 Built & documented using: FAST-CLI
Uses permission:
android.permission.DOWNLOAD_WITHOUT_NOTIFICATION
Events:
ASDDownloader has total 12 events.
DownloadCompleted

Event triggered when the file download is completed. Provides the custom ID and file path.
| Parameter | Type | 
|---|---|
| id | number | 
| filePath | text | 
DownloadProgress

Event triggered when the file download progress is updated.
| Parameter | Type | 
|---|---|
| id | number | 
| percentProgress | number | 
| totalSize | number | 
| downloadedSize | number | 
DownloadCancelled

Event triggered when the file download is canceled.
| Parameter | Type | 
|---|---|
| id | number | 
| message | text | 
OnError

Event triggered when there is an error occurred during the file download. Provides the error message.
| Parameter | Type | 
|---|---|
| errorMessage | text | 
FileMoved

Event raised when a file is successfully moved. Returns the destination path of the moved file.
| Parameter | Type | 
|---|---|
| newPath | text | 
FileRenamed

Event raised when a file is successfully renamed. Returns the new path of the renamed file.
| Parameter | Type | 
|---|---|
| newPath | text | 
FileCopied

Event raised when a file is successfully copied. Returns the new path of the copied file.
| Parameter | Type | 
|---|---|
| newPath | text | 
FileDeleted

Event raised when a file is successfully deleted. Returns the deleted file path.
| Parameter | Type | 
|---|---|
| filePath | text | 
FolderCreated

Event raised when a folder is created. Returns the created folder path.
| Parameter | Type | 
|---|---|
| folderPath | text | 
TextReceived

Event raised when text is successfully received from a file.
| Parameter | Type | 
|---|---|
| fileText | text | 
FileSaved

Event raised when a file is successfully saved. Returns the saved file path.
| Parameter | Type | 
|---|---|
| filePath | text | 
FileAppended

Event raised when text is successfully appended to a file. Returns the path of the appended file.
| Parameter | Type | 
|---|---|
| filePath | text | 
Methods:
ASDDownloader has total 26 methods.
DownloadFile

Downloads a file and saves it to ASD or a specified path. Specify the file name with file extension, eg. file.pdf
| Parameter | Type | 
|---|---|
| url | text | 
| fileName | text | 
| id | number | 
CancelDownload

Cancels a download with the specified ID.
| Parameter | Type | 
|---|---|
| id | number | 
IsDownloading

Checks if a download is in progress for the specified ID.
| Parameter | Type | 
|---|---|
| id | number | 
GetTotalSize

Gets the total size of the download for the specified ID.
| Parameter | Type | 
|---|---|
| id | number | 
GetDownloadedSize

Gets the downloaded size of the download for the specified ID.
| Parameter | Type | 
|---|---|
| id | number | 
GetPercentProgress

Gets the download progress percentage for the specified ID.
| Parameter | Type | 
|---|---|
| id | number | 
FileExists

Check if a file already exists from the given file path
| Parameter | Type | 
|---|---|
| filePath | text | 
DeleteFile

Delete a file or directory (including its contents) from the ASD using the given file path.
| Parameter | Type | 
|---|---|
| filePath | text | 
GetASD

Get the actual App Specific Directory (ASD) path
CreateFolder

Create a new folder in the ASD using the given folder name
| Parameter | Type | 
|---|---|
| folderName | text | 
GetFilesList

Get a list of files from the given path
| Parameter | Type | 
|---|---|
| path | text | 
GetFoldersList

Get a list of folders from the given path
| Parameter | Type | 
|---|---|
| path | text | 
CopyFileAsync

Copy a file from the source path to the destination path asynchronously
| Parameter | Type | 
|---|---|
| sourcePath | text | 
| destinationPath | text | 
FilesListFromAssets

Get a list of files from the app's assets
CopyFileFromAssets

Copy a file from the app's assets to a specified destination path
| Parameter | Type | 
|---|---|
| assetFileName | text | 
| destinationPath | text | 
MoveFileAsync

Move a file asynchronously from the source path to the destination path.
| Parameter | Type | 
|---|---|
| sourcePath | text | 
| destinationPath | text | 
RenameFile

Rename a file from the given file path to a new file name
| Parameter | Type | 
|---|---|
| filePath | text | 
| newFileName | text | 
ChangeFileExtension

Change the extension of a file to the specified extension.
| Parameter | Type | 
|---|---|
| filePath | text | 
| newExtension | text | 
FileSize

Get the size of a file from the given file path
| Parameter | Type | 
|---|---|
| filePath | text | 
FileName

Get the file name from a given file path.
| Parameter | Type | 
|---|---|
| filePath | text | 
MimeType

Get the MIME type of a file from the given file path. Use file path as full file path or file content URI.
| Parameter | Type | 
|---|---|
| filePath | text | 
ConvertFileSize

Converts a file size in bytes to a human-readable format (KB, MB, GB, etc).
| Parameter | Type | 
|---|---|
| fileSizeInBytes | number | 
SaveFile

Save text to a file at the given path.
| Parameter | Type | 
|---|---|
| text | text | 
| filePath | text | 
ReadFile

Read text from a file at the given path.
| Parameter | Type | 
|---|---|
| filePath | text | 
AppendToFile

Append text to a file at the given path.
| Parameter | Type | 
|---|---|
| text | text | 
| filePath | text | 
GetSdkVersion

Get the Android SDK version.
Designer:
ASDDownloader has total 4 designer properties.
ShowNotification
- Input type: boolean
- Default value: false
NotifyCompleted
- Input type: boolean
- Default value: false
NotificationTitle
- Input type: string
- Default value: Downloading File
NotificationDescription
- Input type: string
- Default value: File download in progress
Setters:
ASDDownloader has total 5 setter properties.
CustomDownloadPath

Set a custom download path other than the app-specific directory (ASD).
- Input type: text
ShowNotification

Set to true to show system downloading notification, false to keep it hidden.
- Input type: boolean
NotifyCompleted

Set to true to show system download completed notification, false to keep it hidden.
- Input type: boolean
NotificationTitle

Set the title of the system download notification.
- Input type: text
NotificationDescription

Set the description of the system download notification.
- Input type: text
Download
Version 7: com.thekstudio.ASDDownloaderV7.aix (37.4 KB) without ID feature.
Version 8: com.thekstudio.asddownloader.aix (22.9 KB) with ID feature
Note: While testing in companion enable show notification to avoid error due to permission error in companion.
Documentation generated using FAST by Jewel and block images generated using Extension Docs generator by Akshat.
Leave a like if found useful 




