MultiThreadDownload
MultiThreadDownload copied to clipboard
Speed limitation
I need download speed limitation for each or all download tasks, and is able to set in configuration or on downloadRequest init. It is possible?
The lib isn't support speed limitaion for now. Acturally, I haven't thought about it. Do you have some ideas?
It would be nice to implement this. I have an Ideas but I don't know how to get this done. I saw somewhere multi thread download lib with speed limitation, so it is possible.
I think I made something by calling
DownloadRequest request = new DownloadRequest.Builder()
.setTitle(getFileName()+".mp3")
.setUri(item.getLink())
.setTag(item.getResult().getTag())
.setFolder(getDownloadFolder())
.setMaxRate(300)//kBps
.setTasks(1)//threads
.setRateEnabled(true)// default false
.build();
DownloadConfiguration downloadConfiguration = new DownloadConfiguration();
downloadConfiguration.setMaxThreadNum(10);
downloadConfiguration.setThreadNum(3);
downloadConfiguration.setTotalRateLimitEnabled(true);//and this overrides download request if reqvest is false
downloadConfiguration.setRateLimit(500);// override
DownloadManager.getInstance().init(getApplicationContext(), downloadConfiguration);
i'll make sure if its works without bugs
@Demuss did you make it?