here is simple few lines of code that can be implemented to initiate instant download
DownloadManager mgr = (DownloadManager)getSystemService(DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse("www.example.com/name.mp4");
DownloadManager.Request request = new DownloadManager.Request(
downloadUri);
request.setAllowedNetworkTypes(
DownloadManager.Request.NETWORK_WIFI
| DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setDescription("mohammediatechnologies.in")
.setNotificationVisibility(request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
.setDestinationInExternalPublicDir("/videotest", "yourfilename.ext");
mgr.enqueue(request);
DownloadManager mgr = (DownloadManager)getSystemService(DOWNLOAD_SERVICE);
Uri downloadUri = Uri.parse("www.example.com/name.mp4");
DownloadManager.Request request = new DownloadManager.Request(
downloadUri);
request.setAllowedNetworkTypes(
DownloadManager.Request.NETWORK_WIFI
| DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setDescription("mohammediatechnologies.in")
.setNotificationVisibility(request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
.setDestinationInExternalPublicDir("/videotest", "yourfilename.ext");
mgr.enqueue(request);
Holo
ReplyDelete