aigestudio / multithreaddownloader Goto Github PK
View Code? Open in Web Editor NEWLight weight and simple Multi-Thread Downloader for Android
Light weight and simple Multi-Thread Downloader for Android
我不知道System.currentTimeMillis()
性能怎么样.
但我觉得这里变成百分比回调给UI
层比较好,这样UI最多刷新100
次.
还有就是为什么新文件下载是单线程,续传的时候 又成了多线程?
Cant run the sample failure callback returns "divide by zero" error
我在做版本更新,默认下载位置是/data/data/包名/cache,下载成功后跳转到安装时提示解析失败,我上网搜了应该是权限问题,用了网上的几个方案都没解决,官方建议是写入ContentProvider中,但是好麻烦,这个能不能改了?
Hi,
"D/DLManager: Resume task from database.
W/DLManager: Downloading urls is out of range."
What is the meaning of these messages?
and one more thing, please.
Even though I deleted the files that i downloaded, the app refuses to download the files again.
" D/DLTask: The file which we want to download was already here. "
用回调的唉。。。问题是 如果我有多个activity在下载 如何解决同步问题?
How to calculate download speed ?!
下载完成后,再次点击下载,一直显示 xxx is downloading...
进度条也不更新。
刚点击开始下载,马上dlStop,再点击开始就会一直onError: 101 XXXX is downloading.,无论是取消下载还是会onError: 101 XXXX is downloading
取消下载public void dlCancel(String url,String dirPath) 中:
List infos = sDBManager.queryThreadInfos(url);
if (null != infos && infos.size() != 0) {
sDBManager.deleteThreadInfos(url);
}
删除所有当前url所有线程信息,直接调用sDBManager.deleteThreadInfos(url);就可以;
deleteThreadInfos(url)实现也不对,应该是daoThread.deleteInfos(url);而不是daoThread.deleteInfo(url);
url含中文不能自动处理?需要手动encode吗?
hello,
how can get status of download
is downloading, is stop or....?
这个是什么原因?是不能下载还是不能在本地预创建文件???
rt
if (info.file.exists() && info.file.length() == info.totalBytes) {
Log.d(TAG, "The file which we want to download was already here.");
return;
}
上边这个地方已经下载过了仅仅是Log提示,不能满足我现在的需求,我用这个库做版本更新,下载apk成功后没有安装退出了APP,再进来提示更新时又执行下载,这时只有onPrepare()回调执行了,完了就提示上边这个了,但是我希望能提示我已经下载好了可以直接安装,我觉得有两个方案:1. 这里直接回调onFinish(File file),这样是可行的但是逻辑不够合理; 2. 加个回调onAlreadyExists(File file) 或者 onDownloaded(FIle file)之类的。
上边这些只是我个人的想法,不知道合不合理,盼答复!
下次启动应用怎么查询历史和继续下载呢?
After parse m3u8 file, it's a playlist. When I download this playlist , how to associate to the m3u8 file.
在下载的 activity 的 onDestroy 中调用了 dlStop 方法;但是在应用重新启动之后,进行 dlStart 还是重新开始下载的,有没有办法能保证应用重启之后还能继续上次的进度下载?
log 日志有如下记录,但是下载进度还是从 0 开始计算的。
11-04 09:44:06.544 8176-8210/com.g17.game.sdzs D/DLManager﹕ http://xxxxxxxxx will be resume.
取消下载后会Resume task from memory,重新开始导致最后下载的文件出错
Hello,
Thank you for the project.
Is it possible to download HTML files?
Thank you,
为下载完成的退出应用后无法获取保存的下载进度,且在a页面进入到b页面下载退出b页面后无法更新下载进度。
http1.1协议默认就是chunked模式的,使用Gzip压缩,这样就会导致获取不到content_length,导致不能创建文件或者代码中有直接return处理吗?
如何获取下载队列里面的所有任务,和任务信息
如何设置最大下载数量
文件显示已经下载完了,但是实际上文件只下载了一部分。例如1.1m的mp3文件,实际上下载下来的只有1.0m。
DLInfo dlInfo = DLManager.getInstance(DownloadActivity.this).getDLInfo(Constant.WZURL);
dlInfo.currentBytes no data,Always be 0
dlInfo.currentBytes 没有数据,一直都是0
希望能获取下载队里 里面所有的下载任务,并且返回相应的状态和进度。也可以根据url下载链接查询正在下载的任务状态和进度。
Hi. We can not download from redirect links like this :
http://s2.namasha.com/videos/dl/6936051306
The multithreaddownloader cant find realy file name and type .
这两天读了一下源码,写的太棒了。完全挑不出问题。
我想实现点击多个下载任务时,只有两个会下载,其他任务在等待,这个可以实现么?
I debugged it , when http response code is 206,
in DLTask.java => in dlInit() => in case HTTP_PARTIAL:
, info.totalBytes becomes greater than zero but condition is "info.totalBytes <= 0" . When i changed this condition to "info.totalBytes > 0" i can download file successfully.
But if I don't change that , I can't download file .
看了一下代码,里面是有判断在WIFI 和 3G网络下才下载,
但我在开发android电视方面的应用,连接的是有线网络,
是否可以提供一个无论是什么网络,只要网络连接了,就可以下载的接口?
Thank you!
下载文件在阿里oss,文件大小为186,460bytes
是不是可以抛个异常?
hi and thank for this awesome library.
can you add some extra method to DlManager
dlISDownloading(String Url) // that method must return true if download is in progress now and false if is not
and dlIsStoped(String Url) // that method must return true if download is stoped and false if it not exist in db
thank you in advance.
表现为下载的进度不动了,手动暂停时,由于走不到DLThread里面,不走DLTask的onStop方法,然后TASK_DLING中无法删除这个任务,出现死循环,无法手动暂停或开始任务,只能dlCancel删除下载任务。
不太清楚为什么会出现这种情况。
文件名问题
java.io.IOException: open failed: ENAMETOOLONG (File name too long)
info = new TaskInfo(FileUtil.createFile(dirPath, fileName), url, realUrl, 0, 0);
cn.aigestudio.downloader.bizs.DLTask
162行
if (info.file.exists() && info.file.length() == info.totalBytes&& info.file.length()!=0) {
Log.e(TAG, "The file which we want to download was already here.");
info.listener.onFinish(info.file);//建议加上这句 文件存在 返回onfinish 不然已经下载过的无法知道
return;
}
cn.aigestudio.downloader.bizs.DLManager dlStart
文件下载成功删除了文件 再次打开程序 就会有个bug db有数据 文件却不存在了 不会重新下载
//建议删除数据库 重新开始下载
if(dlInfo!=null) {
File file = new File(dlInfo.dirPath + dlInfo.fileName);
if (!file.exists() || file.length() == 0) {//不存在或者长度==0
DLDBManager.getInstance(context).deleteTaskInfo(url);
}
}
First of all Thanks for this amazing library.
There are still many bugs so please solve them
Many times it doesn't download files and gives negative values in onProgress sometimes it downloads corrupt files.
And how can I set threads number. How many threads it uses by default to download files?
And also please translate the Readme file in English
Waiting for your reply...
Thanks :)
发现下载某些服务器上的文件时,出现
D/DLManager﹕ javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
建议下载时忽略所有证书
如何获取下载任务的状态,比如 正在下载中 已暂停 等待中 连接中。
你好,我使用AWS S3的下载影片内容高达700MB,结果都跑到80%~90%左右,之后就不会跑onProgress,但是我直接去看档案已经下载完成了,有方法解决吗?
我有试过100MB以内的没有问题。
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object reference
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:746)
at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:774)
at cn.aigestudio.downloader.bizs.DLManager.dlStop(DLManager.java:267)
at cn.aigestudio.downloader.bizs.DLManager.dlCancel(DLManager.java:286)
at com.seowhy.video.util.CacheUtils.deleteLessonCache(CacheUtils.java:299)
at com.seowhy.video.util.CacheUtils.deleteCourseCache(CacheUtils.java:397)
at com.seowhy.video.adapter.UserCacheApapter$CacheViewHolder.onBtnDeteleClick(UserCacheApapter.java:110)
at com.seowhy.video.adapter.UserCacheApapter$CacheViewHolder$$ViewBinder$2.doClick(UserCacheApapter$CacheViewHolder$$ViewBinder.java:34)
at ...
不知道是不是我的错?
where i can find number of connection and thread? I want encrypt data before saving on storage. where i have to edit? and I prefer Only one connection because of my encryption.
多线程下载时,出错后回调onStop(),并没有回调onError()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.