From bf48e2da9a8cb5fdaa9405bfba4253bd9df68369 Mon Sep 17 00:00:00 2001 From: Jacksgong Date: Mon, 5 Jun 2017 01:23:50 +0800 Subject: [PATCH] chore: upgrade version name(1.4.3->1.5.0) code(40-41) --- CHANGELOG-ZH.md | 18 ++++++++++++++++++ CHANGELOG.md | 18 ++++++++++++++++++ README-zh.md | 2 ++ README.md | 5 ++++- gradle.properties | 4 ++-- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CHANGELOG-ZH.md b/CHANGELOG-ZH.md index 18281b9c..ca8bdb48 100644 --- a/CHANGELOG-ZH.md +++ b/CHANGELOG-ZH.md @@ -2,6 +2,24 @@ > [ Change log in english](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md) +## Version 1.5.0 + +_2017-06-05_ + +#### 新接口 + +- 提高实用性: 支持对单个任务多连接(多线程)下载。 Closes #102 +- 提高实用性: 支持通过`ConnectionCountAdapter`定制对每个任务使用连接(线程)数据的定制(可以通过`FileDownloader#init`设置进去) +- 提高性能: 重构整个下载的逻辑与原始回调逻辑,并删除了1000行左右的`FileDownloadRunnable`。 + +对于每个任务默认的连接(线程)数目策略,你可以通过`ConnectionCountAdapter`来定制自己的策略: + +- 1个连接(线程): 文件大小 [0, 1MB) +- 2个连接(线程): 文件大小 [1MB, 5MB) +- 3个连接(线程): 文件大小 [5MB, 50MB) +- 4个连接(线程): 文件大小 [50MB, 100MB) +- 5个连接(线程): 文件大小 [100MB, -) + ## Version 1.4.3 _2017-05-07_ diff --git a/CHANGELOG.md b/CHANGELOG.md index 48259770..6fa7210a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ > [中文迭代日志](https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG-ZH.md) +## Version 1.5.0 + +_2017-06-05_ + +#### New Interfaces + +- Improve Practicability: Support multiple-connection(multiple threads) for one downloading task. Closes #102 +- Improve Practicability: Support `ConnectionCountAdapter` to customize connection count for each task(you can set it through `FileDownloader#init`). +- Improve Performance: Refactor whole download logic and origin callback logic and remove 1000 line class `FileDownloadRunnable`. + +The default connection count strategy for each task, you can customize it through `ConnectionCountAdapter`: + +- one connection: file length [0, 1MB) +- two connections: file length [1MB, 5MB) +- three connections: file length [5MB, 50MB) +- four connections: file length [50MB, 100MB) +- five connections: file length [100MB, -] + ## Version 1.4.3 _2017-05-07_ diff --git a/README-zh.md b/README-zh.md index 2a799da9..b9fc537e 100644 --- a/README-zh.md +++ b/README-zh.md @@ -19,6 +19,7 @@ Android 文件下载引擎,稳定、高效、灵活、简单易用 ### 特点 - 简单易用 +- 单任务多线程/多连接(并支持通过`ConnectionCountAdapter`定制) - 高并发 - 灵活 - 可选择性支持: 独立/非独立进程 @@ -267,6 +268,7 @@ if (parallel) { | connection | FileDownloadConnection | FileDownloadUrlConnection | FileDownloadUrlConnection | 传入定制化的网络连接组件,用于下载时建立网络连接 | outputStreamCreator | FileDownloadOutputStream | FileDownloadRandomAccessFile、FileDownloadBufferedOutputStream、FileDownloadOkio | FileDownloadRandomAccessFile | 传入输出流组件,用于下载时写文件使用 | maxNetworkThreadCount | - | - | 3 | 传入创建下载引擎时,指定可用的下载线程个数 +| ConnectionCountAdapter | ConnectionCountAdapter | DefaultConnectionCountAdapter | DefaultConnectionCountAdapter | 根据任务指定其线程数 > 如果你希望Okhttp作为你的网络连接组件,可以使用[这个库](https://github.com/Jacksgong/filedownloader-okhttp3-connection)。 diff --git a/README.md b/README.md index 32180156..ac6f1a4a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ FileDownloader is installed by adding the following dependency to your `build.gr ```groovy dependencies { - compile 'com.liulishuo.filedownloader:library:1.4.3' + compile 'com.liulishuo.filedownloader:library:1.5.0' } ``` @@ -37,6 +37,7 @@ From now on, FileDownloader support following components to be customized by you | Connection | [FileDownloadConnection][FileDownloadConnection-java-link] | [FileDownloadUrlConnection][FileDownloadUrlConnection-java-link] | OutputStream | [FileDownloadOutputStream][FileDownloadOutputStream-java-link] | [FileDownloadRandomAccessFile][FileDownloadRandomAccessFile-java-link] | Database | [FileDownloadDatabase][FileDownloadDatabase-java-link] | [DefaultDatabaseImpl][DefaultDatabaseImpl-java-link] +| ConnectionCountAdapter | [ConnectionCountAdapter][ConnectionCountAdapter-java-link] | [DefaultConnectionCountAdapter][DefaultConnectionCountAdapter-java-link] > If you want to use okhttp as your connection component, the simplest way is [this repo](https://github.com/Jacksgong/filedownloader-okhttp3-connection). @@ -97,3 +98,5 @@ limitations under the License. [DefaultDatabaseImpl-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/services/DefaultDatabaseImpl.java [FileDownloadOutputStream-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadOutputStream.java [FileDownloadRandomAccessFile-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadRandomAccessFile.java +[ConnectionCountAdapter-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadHelper.java#L54 +[DefaultConnectionCountAdapter-java-link]: https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/DefaultConnectionCountAdapter.java diff --git a/gradle.properties b/gradle.properties index 74fe4afe..1cd58905 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.4.3 -VERSION_CODE=40 +VERSION_NAME=1.5.0 +VERSION_CODE=41 BUILD_TOOLS_VERSION=25.0.0 COMPILE_SDK_VERSION=25