Click here to Skip to main content
15,120,478 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my problem is that how can i dowmload video using download manager claas??

What I have tried:

Java
downloadManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
                Uri Download_Uri = Uri.parse("https://r6---sn-4g5edn7z.googlevideo.com/videoplayback?sparams=clen,dur,ei,expire,gir,id,initcwndbps,ip,ipbits,itag,keepalive,lmt,mime,mm,mn,ms,mv,nh,pcm2cms,pl,requiressl,source,upn&clen=2281997&source=youtube&mime=video%2Fwebm&requiressl=yes&ipbits=0&signature=2B3FEC4A1207E13057510479A324BEF4A4C36097.27E695A45BA64A999E7C49A9A9E55943C3647FEA&gir=yes&upn=bb7P5QNar4A&ei=wmsZWIq3LomQjAbghYXwCg&pl=18&ip=39.46.187.91&id=o-ADkQrc2OSGBMttIbY60smPkeakibLgTGXqQZuRYSs1Ve&keepalive=yes&expire=1478082594&itag=278&dur=193.151&key=cms1&lmt=1478032654888965&cpn=YPiRbJBmQGztUmtx&alr=yes&ratebypass=yes&c=WEB&cver=1.20161031&cm2rm=sn-2uja-pncz7d,sn-hpazl76&redirect_counter=2&cms_redirect=yes&mm=34&mn=sn-4g5edn7z&ms=ltu&mt=1478060931&mv=m&nh=IgpwcjAzLm1pbDAxKgkxMjcuMC4wLjE&req_id=efd53053a8c04649&rn=4");
                DownloadManager.Request request = new DownloadManager.Request(Download_Uri);

                request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE);
               // request.setAllowedOverRoaming(false);

                request.setTitle("My Data Download");
                request.setDescription("DownLoading.........");
                request.setDestinationInExternalFilesDir(this, Environment.DIRECTORY_DOWNLOADS, "CountryList.json");
                downloadReference = downloadManager.enqueue(request);

                TextView showCountries = (TextView) findViewById(R.id.countryData);
                showCountries.setText("Getting data from Server, Please WAIT...");
Posted
Updated 5-Nov-16 0:06am
v3

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900