安卓原生版本的DownloadManager,通知栏可见,可限制多种网络状态。 【升级环境编译】
下载。
download({params},callback(ret))
url:
savePath:
header:
notificationVisibility:
title:
description:
allowedNetworkTypes:
allowedOverRoaming:
allowedOverMetered:
requiresCharging:
requiresDeviceIdle:
allowScanningByMediaScanner:
ret:
{
code: 0 , //0正常,-1错误
msg : "" //提示信息
}
var downloadManager = api.require('downloadManager2');
downloadManager.download({
url: 'http://803p0y.com1.z0.glb.clouddn.com/efdc2c4710a18995282e55dac86258b9_d',
title:"江华字牌"
}, function(ret){
console.log(JSON.stringify(ret));
});
Android系统。