This shows you the differences between two versions of the page.
built_in:downloader [2015/03/29 11:56] octazid [Table] |
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 | ||
- | | Downloader.Download(sourceURI, | ||
- | | Downloader.GetProgress() | ||
- | | Downloader.GetSize() | ||
- | | Downloader.IsComplete() | ||
- | | Downloader.SetOnComplete(callback) | ||
- | |||
- | =====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:// |