Downloader creates a Downloader object for downloading files directly from the internet to the device's local storage.
app.CreateDownloader(
options ) ->
app object - Downloader
Example - Example
function OnStart()
{
var srcFileUrl="http://sgarman.net/downloadable.txt";
var targetDir="/sdcard";
dload = app.CreateDownloader();
dload.SetOnComplete( dload_OnComplete );
dload.Download( srcFileUrl, targetDir );
}
function dload_OnComplete()
{
app.ShowPopup("Download complete");
}
The following methods are avaiable on the Downloader object:
unknown
destroys object
string - url path
string - path to file or folder ( "/absolute/..." or "relative/..." )
string
Download file
get current download progress
get target download size
return wether download compleated or not
?
function()
? called when download cancelled
function()
called when download finished
?
called when error occurred while downloading
object id