This shows you the differences between two versions of the page.
built_in:downloader [2015/03/21 16:38] octazid layout changes |
built_in:downloader [2018/04/19 23:14] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Downloader ====== | ||
- | For downloading files (including zip files) //direct to sdcard//, you can use the app.CreateDownloader() method like this: | ||
- | < | ||
- | |||
- | ===== Methods ===== | ||
- | ^Method ^Description ^ | ||
- | |Downloader.Download(sourceURI, | ||
- | |Downloader.GetProgress() | returns fract value 0..1, but " | ||
- | |Downloader.IsComplete() |returns true/false | | ||
- | |Downloader.SetOnComplete(callback) |Should be done before starting the download. | | ||
- | |||
- | =====Example code snippet ===== | ||
- | <code javascript> | ||
- | dload = app.CreateDownloader(); | ||
- | dload.SetOnComplete( dload_OnComplete ); | ||
- | dload.Download( srcFileUrl, targetDir ); | ||
- | |||
- | function dload_OnComplete() | ||
- | { | ||
- | // we know download is ready now | ||
- | // (but not if success or not) | ||
- | } | ||
- | |||
- | </ | ||
- | |||
- | Thanks to Dave (forum: https:// |