Skip to content

Download

Non-Visible component
Category Requires Version
Connectivity API 21, Android 5.0 Lollipop 2

Overview

The Download component is a non-visible component that allows users to download any file to the device

Permissions

Events

Download Complete

Event to detect if the download is successful finished. You can use the "filePath" to use the downloaded file into your app. The "fileSize" will be returned in bytes.

Params
file Path Text
file Name Text
file Size Number

Got File Size

Event to detect file size is ready to be used.

Params
size Number

Notification Clicked

Event to detect when the user clicks on a running download, either from a system notification or from the downloads UI.

On Download Progress Changed

Get the progress (in percentage) of the current download task.

Params
progress Number

Methods

Download

Start the download of the given download url.

Get File Size

Get the file size (in bytes) of a file that is stored online or on your device. The block detect automatic if it is a online path or not. You will get the result in the "Got File Size" event.

Params
path Text

Show Download

You can open the download folder with this block.

Properties

Allow Over Roaming

Boolean Default: False ➖ Read Write - Designer Blocks

Set whether this download may proceed over a roaming connection.

Description

Text Default: Downloading file.. ➖ Read Write - Designer Blocks

Set the description that you will see in the download notification.

Download URL

Text ➖ Read Write - Designer Blocks

Set here the url to the file that you want to download.

Is Download Manager Available

⚠ Deprecated

Boolean ➖ Read - Blocks

This function is deprecated. Do not use it anymore. We will remove it in the future. Since we support min API 14 the download manager is by default available. The download manager was added in API 9.

Require Charging

Boolean Default: False ➖ Read Write - Designer Blocks

Specify that to run this download, the device needs to be plugged in. Works only for devices with api >= 24.

Require Device Idle

Boolean Default: False ➖ Read Write - Designer Blocks

Specify that to run, the download needs the device to be in idle mode. Idle mode is a loose definition provided by the system, which means that the device is not in use, and has not been in use for some time. Works only for devices with api >= 24.

Save File As

Text Default: NewFile.png ➖ Read Write - Designer Blocks

Set here the new filename for the file that you want to download.

Scan By Media Scanner

Boolean Default: True ➖ Read Write - Designer Blocks

If the file to be downloaded is to be scanned by MediaScanner.

Show Notification

Boolean Default: True ➖ Read Write - Designer Blocks

Control whether a system notification is posted by the download manager while this download is running or when it is completed.

Suppress Warnings

Boolean Default: True ➖ Read Write - Designer Blocks

If false you will see a toast message with a error message when a error is occurred.

Title

Text Default: Download.. ➖ Read Write - Designer Blocks

Set the title that you will see in the download notification.


Last update: November 9, 2022