|
|
|
|
|
- Properties specific to DownloadParameter variables
DownloadParameter (Variable type)
The DownloadParameter type is used to define all the advanced characteristics of a file download performed by DownloadAdd. You can define and change the characteristics of this download using different WLanguage properties. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
PROCEDURE DownloadCompleted(InfoDownload is DownloadInfo)
IF InfoDownload.Status = downloadStatusSuccessful THEN
Info(InfoDownload.Title + " has been downloaded successfully."
RETURN False
END
ParameterDownload is DownloadParameter
ParameterDownload.Source = ...
"https://windev.com/storage/en_US/img/visual/25/logo-pcsoft.png"
ParameterDownload.Title = "PC Soft Logo"
ParameterDownload.Description = "PC Soft company logo"
ParameterDownload.Destination = SysDirExternalStorage(1, sseAppDownload)
ParameterDownload.MobileNetworkAllowed = True
ParameterDownload.MeteredNetworkAllowed = False
ParameterDownload.RequiresCharging = True
ParameterDownload.NotificationMode = downloadNotifProgressAndCompletion
ParameterDownload.ProcedureEnd = "DownloadCompleted"
nID is int = DownloadAdd(ParameterDownload)
telInfo is DownloadInfo = DownloadGetInfo(nID)
Info(telInfo.Title)
Propiedades Properties specific to DownloadParameter variables The following properties can be used to handle the characteristics of a download: | | | Property name | Type used | Effect |
---|
Description | Character string | Download description displayed in the notification (if enabled). Note: This property is optional. | Destination | Character string | Physical address where the file will be stored. The path must correspond to: - the external storage of the device,
- the folders of the application,
- the public downloads folder, accessible by calling SysDirExternalStorage with the ssePublicDownload constant.
If no destination is specified or if this property is an empty string, the file will be downloaded to the public downloads folder.Note: This property is optional. | Header | Array of character strings | Used to add a header to the download request. The following syntax must be used:
<Variable name>.HTTPHeader["Header name"] = "Value of header" | MeteredNetworkAllowed | Boolean | - True (default) if the download can be done over a metered network. A metered network means a network that has a cost to the user, has a data limit or has performance or battery issues.
- False otherwise.
| MobileNetworkAllowed | Boolean | - True (default value) if the mobile network can be used for the download.
- False otherwise.
| NotificationMode | Integer constant | Download notification mode: - downloadNotifNo Notification is not visible.
Note: use of this constant requires the addition of the DOWNLOAD_WITHOUT_NOTIFICATION permission. - downloadProgressionNotification (Default value): As long as the download is in progress, a notification shows the progress and disappears when the download is complete.
- downloadProgressNotificationEnd While the download is in progress, a notification shows the progress and remains visible when the download is complete.
| ProcedureEnd | Global procedure only | Name of the procedure to be called at the end of the download whether it is completed or canceled: - If the application is not started the download is completed, the system starts the application to execute the procedure.
- If the procedure returns True, the download will be removed and the downloaded file will be deleted.
| RequiresCharging | Boolean | - True if the download requires the phone to be charging,
- False (default value) otherwise.
| RoamingAllowed | Boolean | - True (default) if data roaming can be used for the download.
- False otherwise.
| Source | URI variable | http/https address of the file to be downloaded. | Title | Character string | Download title displayed in the notification (if enabled). If this property is not specified or is an empty string (""), a default title based on the name of the downloaded file will automatically be used. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|