Back

CreateDownloader

Downloader returns a Downloader object.

For more information in the detailed docs see CreateDownloader

  dwn = 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");
}
    Copy     Copy All       Run      

The following methods are available on the Downloader object:

  GetProgress() → unknown
  GetSize() → unknown
  GetType() → string: "Downloader"
  IsComplete() → boolean
  Method( name, types, p1, p2, p3, p4 )

unknown
string: url path
string: path to file or folder ( "/absolute/..." or "relative/..." )
string
Download file
get current download progress
get target download size
Returns the control class name.
return whether download compleated or not
string: comma separated: "boolean", "char", "byte", "short", "int", "long", "float", "double"
Allows access to other functions defined on the object in Java via reflection.
function()
? called when download cancelled
function()
called when download finished
function(path)
?
function(error)
called when error occurred while downloading