diff --git a/CHANGELOG-ZH.md b/CHANGELOG-ZH.md index 4c9dc5da..0b44b001 100644 --- a/CHANGELOG-ZH.md +++ b/CHANGELOG-ZH.md @@ -1,5 +1,21 @@ # Change log +## Version 0.2.0 + +_2016-02-15_ + +#### 新接口 + +- `filedownloader.properties-http.lenient`: 添加`http.lenient`用于配置下载引擎中是否需要忽略一些http规范性的错误(如: 忽略 `can't know the size of the download file, and its Transfer-Encoding is not Chunked`), 默认值`false`。 +- `FileDownloadNotificationHelper`: 用于支持在通知栏中的通知对下载引擎中任务下载状态同步的快速集成。 +- `FileDownloader#init(Application,OkHttpClientCustomMaker)`: 用于为下载引擎提供定制的OkHttpClient。 + +#### 修复 + +- 修复: 需要重新启动的列表(`FileDownloadTask.NEED_RESTART_LIST`)不为空并且下载服务断开时出现`Concurrent Modification Exception`的异常。 +- 修复: 下载引擎连接丢失以后,重连任务的回调失效的bug。 +- 修复: 在一些高并发下载情况下,对队列进行暂停,部分暂停不生效的bug。 + ## Version 0.1.9 _2016-01-23_ @@ -28,7 +44,7 @@ _2016-01-23_ #### 修复 -- 修复: 修复`EventPool`中的listener存储器无限制的bug. +- 修复: `EventPool`中的listener存储器无限制的bug. ## Version 0.1.5 @@ -49,8 +65,8 @@ _2016-01-17_ #### 修复 -- 修复在一些高并发的情况下,有可能内部队列存在残留任务的bug,此bug可能可能引发回调被旧的任务吞掉的问题。 -- 修复了出现网络错误,或者其他错误,重新下载无法自动断点续传的bug。 +- 修复: 在一些高并发的情况下,有可能内部队列存在残留任务的bug,此bug可能可能引发回调被旧的任务吞掉的问题。 +- 修复: 出现网络错误,或者其他错误,重新下载无法自动断点续传的bug。 #### 其他 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c147121..68be3123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ > [中文迭代日志](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG-ZH.md) +## Version 0.2.0 + +_2016-02-15_ + +#### New Interfaces + +- `filedownloader.properties-http.lenient`: Add 'filedownloader.properties' for some special global configs, and add 'http.lenient' keyword to 'filedownloader.properties' to handle the case of want to ignore HTTP response header from download file server isn't legal. +- `FileDownloadNotificationHelper`: Refashioning NotificationHelper, let handle notifications with FileDownloader more make sense. #25 +- `FileDownloader#init(Application,OkHttpClientCustomMaker)`: Support customize OkHttpClient which will be used for downloading files. + +#### Fix + +- Fix: Occur 'Concurrent Modification Exception' when Downloader service is unbound or lost connection to service and NeedRestart list not empty. #23 +- Fix: The case of re-connect from lost connection to service but all auto restart tasks' call-back do not effect. +- Fix: In some cases of high concurrency, the Pause on some tasks is no effect. + ## Version 0.1.9 _2016-01-23_ diff --git a/README-zh.md b/README-zh.md index 7fc7ccf8..a6b68e88 100644 --- a/README-zh.md +++ b/README-zh.md @@ -7,7 +7,7 @@ Android 文件下载引擎,稳定、高效、简单易用 > [README DOC](https://github.com/lingochamp/FileDownloader/blob/master/README.md) -> 本引擎依赖okhttp 3.0.1 +> 本引擎依赖okhttp 3.1.2 --- #### 版本迭代日志: [Change Log](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md) @@ -51,13 +51,15 @@ compile 'com.liulishuo.filedownloader:library:0.1.9' #### 全局初始化在`Application.onCreate`中 +> 如果希望定制化用于下载的`OkHttpClient`,建议参考[DemoApplication](https://github.com/lingochamp/FileDownloader/blob/master/demo/src/main/java/com/liulishuo/filedownloader/demo/DemoApplication.java) + ``` public XXApplication extends Application{ ... @Override public void onCreate() { - // 不耗时,做一些简单初始化准备工作,不会启动下载进程 + // 不耗时,仅仅只是缓存下Application的Context不会启动下载进程 FileDownloader.init(this); } @@ -342,6 +344,20 @@ blockComplete -> completed | --- | --- | setDefaultSaveRootPath(path:String) | 在整个引擎中没有设置路径时`BaseDownloadTask#setPath`这个路径将会作为它的Root path +#### `FileDownloadNotificationHelper` + +> 如何快速集成Notification呢? 建议参考[NotificationDemoActivity](https://github.com/lingochamp/FileDownloader/blob/master/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java) + +#### `filedownloader.properties` + +> 如果你需要使用'filedownloader.properties'却在项目根目录下没有找到该文件,可以直接在项目根目录下直接创建一个以'filedownloader.properties'作为文件名的文件即可。 + +> 格式: `keyword=value` + +| 关键字 | 描述 | 默认值 +| --- | --- +| http.lenient | 如果你遇到了: 'can't know the size of the download file, and its Transfer-Encoding is not Chunked either', 但是你想要忽略类似的返回头不规范的错误,直接将该关键字参数设置为`true`即可,我们将会将其作为`chunck`进行处理 | false + ## III. 低内存情况 diff --git a/README.md b/README.md index 5d805abc..a7a4838b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Android multi-task file download engine. > [中文文档](https://github.com/lingochamp/FileDownloader/blob/master/README-zh.md) -> This project dependency on [square/okhttp 3.0.1](https://github.com/square/okhttp) +> This project dependency on [square/okhttp 3.1.2](https://github.com/square/okhttp) ## DEMO @@ -26,7 +26,7 @@ FileDownloader is installed by adding the following dependency to your build.gra ``` dependencies { - compile 'com.liulishuo.filedownloader:library:0.1.9' + compile 'com.liulishuo.filedownloader:library:0.2.0' } ``` @@ -36,6 +36,7 @@ dependencies { To begin using FileDownloader, have your`Application#onCreate` invoke the `FileDownloader.init(this)` such as: +> If your want to customize `OkHttpClient` for downloading files, @see [DemoApplication](https://github.com/lingochamp/FileDownloader/blob/master/demo/src/main/java/com/liulishuo/filedownloader/demo/DemoApplication.java) ``` public XXApplication extends Application{ @@ -44,7 +45,7 @@ public XXApplication extends Application{ @Override public void onCreate() { super.onCreate(); - // Just cache ApplicationContext + // Just cache Application's Context. FileDownloader.init(this); } @@ -171,7 +172,7 @@ for (int i = 0; i < count; i++) { queueSet.disableCallbackProgressTimes(); // do not need for each task callback `FileDownloadListener#progress`, // we just consider which task will complete. so in this way reduce ipc will be effective optimization -// all tasks auto retry 1 time if download fail +// each task will auto retry 1 time if download fail queueSet.setAutoRetryTimes(1); if (serial) { @@ -340,6 +341,20 @@ blockComplete -> completed | --- | --- | setDefaultSaveRootPath(path:String) | The path is used as Root Path in the case of task without setting path in the entire Download Engine +#### `FileDownloadNotificationHelper` + +> How to integrate with Notification quickly? Recommend to refer to [NotificationDemoActivity](https://github.com/lingochamp/FileDownloader/blob/master/demo/src/main/java/com/liulishuo/filedownloader/demo/NotificationDemoActivity.java) + +#### `filedownloader.properties` + +> If you want to use this property and don't find 'filedownloader.properties' on the root path of your project, please create a new empty file with naming 'filedownloader.properties' on there feel free. + +> Format: `keyword=value`. + +| keyword | description | default +| --- | --- +| http.lenient | if you occur exception: 'can't know the size of the download file, and its Transfer-Encoding is not Chunked either', but you want to ignore such exception, set true, will deal with it as the case of transfer encoding chunk. | false + ## Attention diff --git a/filedownloader.properties b/filedownloader.properties index ea2b7959..c503c57d 100644 --- a/filedownloader.properties +++ b/filedownloader.properties @@ -1,5 +1,5 @@ #if you occur exception: 'can't know the size of the download file, and its Transfer-Encoding is not Chunked either', -#but you want to ignore such exception, set true, will As the case of transfer encoding chunk. default false +#but you want to ignore such exception, set true, will deal with it as the case of transfer encoding chunk. default false #if true, will ignore HTTP response header does not has content-length either not chunk transfer #encoding. default false http.lenient=true \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 4b3d15b0..5434f85b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,11 @@ -VERSION_NAME=0.1.9 -VERSION_CODE=10 +VERSION_NAME=0.2.0 +VERSION_CODE=11 BUILD_TOOLS_VERSION=23.0.1 COMPILE_SDK_VERSION=23 GROUP=com.liulishuo.filedownloader ARTIFACT_NAME=FileDownloader -ARTIFACT_DESCRIPTION=多任务多线程并行/指定队列串行、高并发、高稳定性、独立进程、自动断点续传、多功能下载引擎 +ARTIFACT_DESCRIPTION=Android multi-task file download engine. SITE_URL=https://github.com/lingochamp/FileDownloader ISSUE_SYSTEM=github ISSUE_URL=https://github.com/lingochamp/FileDownloader/issues @@ -17,4 +17,4 @@ LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt LICENCE_DIST=repo DEVELOPER_ID=jacksgong DEVELOPER_NAME=Jacks Gong -DEVELOPER_EMAIL=igzhenjie@gmail.com \ No newline at end of file +DEVELOPER_EMAIL=igzhenjie@gmail.com