I am developing an android application in which i have to download multiple sound files from a server. Each file has approximately 10MB size. For that i have used Download Manager to download multiple files from server. But when i downloading multiple files from server download process is being killed by android os after downloading 2 or 3 sound files. Because of download process requires more resources and another application on a device requires resources to run. I have googled to solve this problem but can't get any kind of solutions regarding my problem. If anybody has solution of this problem then please suggest me, Or is there any example or sample then also please suggest me.
Below are some code snippet,
Uri Download_Uri = Uri.parse(urls[idList.get(0)]);
DownloadManager.Request request = new DownloadManager.Request(Download_Uri);
long download_id = downloadManager.enqueue(request
.setAllowedNetworkTypes(
DownloadManager.Request.NETWORK_WIFI
| DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle("Downloading...")
.setDescription(Songs[idList.get(0)])
.setDestinationInExternalPublicDir(
Environment.DIRECTORY_DOWNLOADS,
Songs[idList.get(0)] + ".mp3"));
Upper sample is used to initiate download,