Expand file tree Collapse file tree 5 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
> [ Change log in english] ( https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG.md )
4
4
5
+ ## Version 1.5.0
6
+
7
+ _ 2017-06-05_
8
+
9
+ #### 新接口
10
+
11
+ - 提高实用性: 支持对单个任务多连接(多线程)下载。 Closes #102
12
+ - 提高实用性: 支持通过` ConnectionCountAdapter ` 定制对每个任务使用连接(线程)数据的定制(可以通过` FileDownloader#init ` 设置进去)
13
+ - 提高性能: 重构整个下载的逻辑与原始回调逻辑,并删除了1000行左右的` FileDownloadRunnable ` 。
14
+
15
+ 对于每个任务默认的连接(线程)数目策略,你可以通过` ConnectionCountAdapter ` 来定制自己的策略:
16
+
17
+ - 1个连接(线程): 文件大小 [ 0, 1MB)
18
+ - 2个连接(线程): 文件大小 [ 1MB, 5MB)
19
+ - 3个连接(线程): 文件大小 [ 5MB, 50MB)
20
+ - 4个连接(线程): 文件大小 [ 50MB, 100MB)
21
+ - 5个连接(线程): 文件大小 [ 100MB, -)
22
+
5
23
## Version 1.4.3
6
24
7
25
_ 2017-05-07_
Original file line number Diff line number Diff line change 2
2
3
3
> [ 中文迭代日志] ( https://github.com/lingochamp/FileDownloader/blob/master/CHANGELOG-ZH.md )
4
4
5
+ ## Version 1.5.0
6
+
7
+ _ 2017-06-05_
8
+
9
+ #### New Interfaces
10
+
11
+ - Improve Practicability: Support multiple-connection(multiple threads) for one downloading task. Closes #102
12
+ - Improve Practicability: Support ` ConnectionCountAdapter ` to customize connection count for each task(you can set it through ` FileDownloader#init ` ).
13
+ - Improve Performance: Refactor whole download logic and origin callback logic and remove 1000 line class ` FileDownloadRunnable ` .
14
+
15
+ The default connection count strategy for each task, you can customize it through ` ConnectionCountAdapter ` :
16
+
17
+ - one connection: file length [ 0, 1MB)
18
+ - two connections: file length [ 1MB, 5MB)
19
+ - three connections: file length [ 5MB, 50MB)
20
+ - four connections: file length [ 50MB, 100MB)
21
+ - five connections: file length [ 100MB, -]
22
+
5
23
## Version 1.4.3
6
24
7
25
_ 2017-05-07_
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ Android 文件下载引擎,稳定、高效、灵活、简单易用
19
19
### 特点
20
20
21
21
- 简单易用
22
+ - 单任务多线程/多连接(并支持通过` ConnectionCountAdapter ` 定制)
22
23
- 高并发
23
24
- 灵活
24
25
- 可选择性支持: 独立/非独立进程
@@ -267,6 +268,7 @@ if (parallel) {
267
268
| connection | FileDownloadConnection | FileDownloadUrlConnection | FileDownloadUrlConnection | 传入定制化的网络连接组件,用于下载时建立网络连接
268
269
| outputStreamCreator | FileDownloadOutputStream | FileDownloadRandomAccessFile、FileDownloadBufferedOutputStream、FileDownloadOkio | FileDownloadRandomAccessFile | 传入输出流组件,用于下载时写文件使用
269
270
| maxNetworkThreadCount | - | - | 3 | 传入创建下载引擎时,指定可用的下载线程个数
271
+ | ConnectionCountAdapter | ConnectionCountAdapter | DefaultConnectionCountAdapter | DefaultConnectionCountAdapter | 根据任务指定其线程数
270
272
271
273
> 如果你希望Okhttp作为你的网络连接组件,可以使用[ 这个库] ( https://github.com/Jacksgong/filedownloader-okhttp3-connection ) 。
272
274
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ FileDownloader is installed by adding the following dependency to your `build.gr
24
24
25
25
``` groovy
26
26
dependencies {
27
- compile 'com.liulishuo.filedownloader:library:1.4.3 '
27
+ compile 'com.liulishuo.filedownloader:library:1.5.0 '
28
28
}
29
29
```
30
30
@@ -37,6 +37,7 @@ From now on, FileDownloader support following components to be customized by you
37
37
| Connection | [ FileDownloadConnection] [ FileDownloadConnection-java-link ] | [ FileDownloadUrlConnection] [ FileDownloadUrlConnection-java-link ]
38
38
| OutputStream | [ FileDownloadOutputStream] [ FileDownloadOutputStream-java-link ] | [ FileDownloadRandomAccessFile] [ FileDownloadRandomAccessFile-java-link ]
39
39
| Database | [ FileDownloadDatabase] [ FileDownloadDatabase-java-link ] | [ DefaultDatabaseImpl] [ DefaultDatabaseImpl-java-link ]
40
+ | ConnectionCountAdapter | [ ConnectionCountAdapter] [ ConnectionCountAdapter-java-link ] | [ DefaultConnectionCountAdapter] [ DefaultConnectionCountAdapter-java-link ]
40
41
41
42
> If you want to use okhttp as your connection component, the simplest way is [ this repo] ( https://github.com/Jacksgong/filedownloader-okhttp3-connection ) .
42
43
@@ -97,3 +98,5 @@ limitations under the License.
97
98
[ DefaultDatabaseImpl-java-link ] : https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/services/DefaultDatabaseImpl.java
98
99
[ FileDownloadOutputStream-java-link ] : https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadOutputStream.java
99
100
[ FileDownloadRandomAccessFile-java-link ] : https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/stream/FileDownloadRandomAccessFile.java
101
+ [ ConnectionCountAdapter-java-link ] : https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadHelper.java#L54
102
+ [ DefaultConnectionCountAdapter-java-link ] : https://github.com/lingochamp/FileDownloader/blob/master/library/src/main/java/com/liulishuo/filedownloader/connection/DefaultConnectionCountAdapter.java
Original file line number Diff line number Diff line change 1
- VERSION_NAME =1.4.3
2
- VERSION_CODE =40
1
+ VERSION_NAME =1.5.0
2
+ VERSION_CODE =41
3
3
BUILD_TOOLS_VERSION =25.0.0
4
4
COMPILE_SDK_VERSION =25
5
5
0 commit comments