finally, after about 1 year (: D) this is one of the best solutions:
using this library , add to the library project,
or with Android Studio dependencies:
dependencies { compile 'com.mani:ThinDownloadManager:1.3.0' }
This is one of the best and fastest (any) files. Download the library, Too is so easy to use and configure.
for example, in my question (1 year ago) that i wanted to have Multiple-File-Download , it can indicate the size of the thread pool to:
ThinDownloadManager downloadManager = new ThinDownloadManager(DOWNLOAD_THREAD_POOL_SIZE); //DOWNLOAD_THREAD_POOL_SIZE = number of threads.
GOODLUCK !.
Edit to reply to @Bhuvi (install downloaded destination file)
Determine the purpose of the file:
String fileName ="file name"; File root = android.os.Environment.getExternalStorageDirectory(); File dir = new File(root.getAbsolutePath() +`subfolder name`); if (dir.exists() == false) { dir.mkdirs(); } final Uri destinationUri = Uri.parse(dir + fileName);
then setDestinationURI (your path) for ThinDownloadManager
downloadRequest = new DownloadRequest(downloadUri)setDestinationURI(destinationUri).setPriority(DownloadRequest.Priority.HIGH)
Edit @ farhad.kargaran answer - 2017/12/06
as I saw the ThinDownloadManager repository, the latest version is 1.3.0 , but according to @ farhad.kargaran the answer is version 1.4.0 too, I did not test the new version functions, but you can also test the new version according to the answer of @ farhad.kargaran.
Saeid source share