Skip to content

Commit

Permalink
chore: upgrade version name(1.4.3->1.5.0) code(40-41)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacksgong committed Jun 4, 2017
1 parent b2ed360 commit bf48e2d
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 2 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Android 文件下载引擎,稳定、高效、灵活、简单易用
### 特点

- 简单易用
- 单任务多线程/多连接(并支持通过`ConnectionCountAdapter`定制)
- 高并发
- 灵活
- 可选择性支持: 独立/非独立进程
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand All @@ -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).
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit bf48e2d

Please sign in to comment.