Multitask、MultiThread(MultiConnection)、Breakpoint-resume、High-concurrency、Simple to use、Single/NotSingle-process
Java
Jacksgong Merge pull request #1076 from rantianhua/master
refactor: support character set and language Encoding for Content-Dis…
Latest commit 627f7e0 Jul 13, 2018
Permalink
Failed to load latest commit information.
.github docs: fix typo on issue template Sep 11, 2017
.idea chore: upgrade android gradle plugin version and target version Apr 20, 2018
art docs: add message-system and structure image Jan 1, 2018
demo chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
gradle chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
library Merge pull request #1076 from rantianhua/master Jul 13, 2018
.gitignore chore: upgrade android gradle plugin version and target version Apr 20, 2018
.travis.yml chore: fix travis check failed because of build-tool and platforms miss Apr 20, 2018
CHANGELOG-ZH.md chore: upgrade version name(1.7.3->1.7.4) code(64->65) May 19, 2018
CHANGELOG.md chore: upgrade version name(1.7.3->1.7.4) code(64->65) May 19, 2018
LICENSE.txt add license txt & add changelog md Dec 22, 2015
README-zh.md chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
README.md chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
build.gradle chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
checkstyle.xml chore: enable checkstyle on filedownloader Dec 12, 2017
gradle.properties chore(snapshot): adapter deploy snapshot version to sonatype for cont… Jun 8, 2018
gradlew init Dec 16, 2015
gradlew.bat init Dec 16, 2015
install.sh chore: add install and launch script in command Sep 25, 2016
settings.gradle init Dec 16, 2015

README.md

FileDownloader

Android multi-task file download engine.

Download Build Status

中文文档

FileDownloader2

Now, FileDownloader2-OkDownload is released, okdownload will contain all advantage on the FileDownloader and beyond.

Because of FileDownloader unit-test coverage is very low, so all farther features and enhances will be achieved on the okdownload instead of FileDownloader, and FileDownloader will only focuses on bug fixes.

DEMO

Installation

FileDownloader is installed by adding the following dependency to your build.gradle file:

dependencies {
    implementation 'com.liulishuo.filedownloader:library:1.7.4'
}

Snapshots of the development version are available in Sonatype's snapshots repository, you can include on your gradle project through:

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

Open customize component

From now on, FileDownloader support following components to be customized by yourself:

Name Interface Default Impl
Connection FileDownloadConnection FileDownloadUrlConnection
OutputStream FileDownloadOutputStream FileDownloadRandomAccessFile
Database FileDownloadDatabase RemitDatabase
ConnectionCountAdapter ConnectionCountAdapter DefaultConnectionCountAdapter
IdGenerator IdGenerator DefaultIdGenerator
  • If you want to use okhttp as your connection component, the simplest way is this repo.
  • If you don't want to use any database on FileDownloader(the database on FileDownloader is used for persist tasks' breakpoint info) just using NoDatabaseImpl.java

How to valid it?

Just create your own DownloadMgrInitialParams.InitCustomMaker and put those customized component to it, finally init the FileDownloader with it: FileDownloader#init

Welcome PR

If you can improve the unit test for this project would be great.

Usage

By default, the FileDownloadService runs on the separate process, if you want to run it on the main process, just configure on the filedownloader.properties, and you can use FileDownloadUtils.isDownloaderProcess(Context) to check whether the FileDownloadService can run on the current process.

For more readable, Moved to Wiki.

LICENSE

Copyright (c) 2015 LingoChamp Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.