/com.miga.downloadmanager

Use the Android DownloadManager in Titanium

Primary LanguageJavaOtherNOASSERTION

Android DownloadManager support for Titanum

preview

Use the Android default DownloadManager to download files in the background. It will open the system download list when you click on the notification.

var dmg = require("com.miga.downloadmanager");

var filename = url.substring(url.lastIndexOf('/') + 1);
var file = Ti.Filesystem.getFile(Ti.Filesystem.externalStorageDirectory, filename).nativePath;

dmg.startDownload({
    url: url,
    filename: file,
    success: onDone,
    title: "Download",
    description: "Download " + filename
});

function onDone(){
	alert("done");
}