|
|
|
|
|
- Properties specific to DownloadInfo variables
DownloadInfo (Variable type) In french: TéléchargementInfo
The DownloadInfo type is used to read the different details about a download in progress retrieved by DownloadGetInfo. The characteristics of this download can be identified and modified 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)
Properties Properties specific to DownloadInfo variables The following properties can be used to get the details of a download: | | | Property name | Type used | Effect |
---|
Description | Character string | Download description displayed in the notification (if enabled). | Destination | URI variable | Physical address where the file will be stored. | FileSize | 8-byte integer | File size in bytes. | Identifier | Integer | Identifier of the download in the download manager. | Progress | 8-byte integer | Number of bytes downloaded. | Source | URI variable | http/https address of the file being downloaded. | Status | Integer constant | Download status: - downloadStatusFailed: Download failed. The StatusDetails property can be used to get more details.
- downloadPendingStatus: Download pending.
- downloadStatus: Download in progress.
- downloadStatusPause: Download is paused. The StatusDetails property can be used to get more details.
- downloadStatusSuccess: Download successful.
| StatusDetails | Integer | Status details. If the Status property is set to downloadStatusFailed, the StatusDetails property can be used to get the RFC 2616 error code, if it was received. Otherwise, it will correspond to one of the following constants: - downloadErrorInsufficientSpace: Storage space is insufficient.
- downloadErrorExistingFile: The URI points to an existing file.
- downloadErrorUnknown: The error is unknown.
- downloadStorageError: Storage error.
- downloadPauseWaitNewTest: The reason for the pause is a network error, the system is waiting before trying again.
- downloadPauseWaitingForWifi: The reason for the pause is to wait for a WIFI network.
- downloadPauseWaitNetwork: The reason for the pause is waiting for a network connection.
- téléchargementPauseInconnu: The reason for the pause is unknown.
| Title | Character string | Download title displayed in the notification (if enabled). |
Related Examples:
|
Android (WINDEV Mobile): Android Downloads
[ + ] This example illustrates background downloads in WINDEV Mobile and Android. It is no longer necessary to keep the application open to propose the download of a file. The download manager allows you to download large files and to notify the application when the downloads are finished.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|