ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Download functions
  • Required permissions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a new download in the device's download manager. The download will run in the background as soon as the download manager is ready to execute it.
Note: Download functions have no effect in the simulator.
Example
// Procédure à appeler en fin de téléchargement
PROCEDURE FinDeTéléchargement(InfoTéléchargement is TéléchargementInfo)
IF InfoTéléchargement.Etat = downloadStatusSuccessful THEN
    Info("Le téléchargement " + InfoTéléchargement.Titre + " est terminé."
    RETURN False
END


// ---------------
// Crée une variable de type TéléchargementParamètre 
// pour enregistrer les informations du téléchargement
ParamètreTéléchargement is TéléchargementParamètre

// Spécifie les paramètres du téléchargement
ParamètreTéléchargement.Source = ...
	"https://www.pcsoft.fr/img/visuels/download.php?filename=pcsoft/logo-pcsoft.png"
ParamètreTéléchargement.Titre = "Logo PC Soft"
ParamètreTéléchargement.Description = "Logo de l'entreprise PC Soft."
ParamètreTéléchargement.Destination = SysDirExternalStorage(1, sseAppDownload)
ParamètreTéléchargement.RéseauMobileAutorisé = True
ParamètreTéléchargement.RéseauRestreintAutorisé = False
ParamètreTéléchargement.EnCharge = True
ParamètreTéléchargement.ModeNotification = downloadNotifProgressAndCompletion
// Procédure à appeler en fin de téléchargement
ParamètreTéléchargement.ProcédureFin = "FinDeTéléchargement"

// Le téléchargement est ajouté à la liste des téléchargements à effectuer
// (Le téléchargement commencera dès que le gestionnaire de téléchargement pourra le lancer).
nID is int = DownloadAdd(ParamètreTéléchargement)

telInfo is TéléchargementInfo = DownloadGetInfo(nID)

Info(telInfo.Titre)
Syntax
<Result> = DownloadAdd(<Download>)
<Result>: Integer
  • Identifier of the new download,
  • -1 if an error occurred.
<Download>: DownloadParameter variable
Name of the DownloadParameter variable that corresponds to the download to be started.
Only the Source property of the DownloadParameter variable is needed to start the download.
Remarks

Required permissions

This function changes the permissions required by the application.
Permission required: INTERNET
This permission allows the applications to open the network sockets.
Related Examples:
Android Downloads 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.
Component: wd300android.aar
Minimum version required
  • Version 27
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help