This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
built_in:downloader [2015/01/08 14:13] thomaskwd |
built_in:downloader [2018/04/19 23:14] (current) |
||
---|---|---|---|
Line 2: | Line 2: | ||
For downloading files (including zip files) //direct to sdcard//, you can use the app.CreateDownloader() method like this: | For downloading files (including zip files) //direct to sdcard//, you can use the app.CreateDownloader() method like this: | ||
+ | < | ||
===== Methods ===== | ===== Methods ===== | ||
- | ^Method ^Description ^ | + | ^ Method |
- | |Downloader.Download() |You can pass a comma seperated list of file urls to download. | | + | | Downloader.Download(sourceURI, |
- | |Downloader.IsComplete() | | | + | | Downloader.GetProgress() |
- | |Downloader.GetProgress() | | | + | | Downloader.GetSize() |
- | |Downloader.GetSize() | | | + | | Downloader.IsComplete() | returns true/ |
- | |Downloader.SetOnComplete(callback) | | | + | | Downloader.SetOnComplete(callback) |
- | Example code snippet: | + | =====Example code snippet |
- | < | + | < |
dload = app.CreateDownloader(); | dload = app.CreateDownloader(); | ||
dload.SetOnComplete( dload_OnComplete ); | dload.SetOnComplete( dload_OnComplete ); | ||
dload.Download( srcFileUrl, targetDir ); | dload.Download( srcFileUrl, targetDir ); | ||
- | function dload_OnComplete() { | + | function dload_OnComplete() |
+ | { | ||
// we know download is ready now | // we know download is ready now | ||
// (but not if success or not) | // (but not if success or not) | ||
Line 23: | Line 25: | ||
</ | </ | ||
+ | |||
+ | ===== Options ===== | ||
+ | |||
+ | ^ Option | ||
+ | | NoDialog | ||
Thanks to Dave (forum: https:// | Thanks to Dave (forum: https:// |