Git Product home page Git Product logo

filedownloader's Introduction

FileDownloader

Android multi-task file download engine.

Download Build Status

中文文档

DEMO

Installation

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

dependencies {
    compile 'com.liulishuo.filedownloader:library:1.6.8'
}

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 DefaultDatabaseImpl
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.

  • Comments as much as possible.
  • Commit message format follow: AngularJS's commit message convention .
  • The change of each commit as small as possible.
  • As far as possible follow the advice from Inspection by IDE(Such as 'Inspect Code' in Android Studio).

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.

filedownloader's People

Contributors

jacksgong avatar maomaobug avatar zhangyangjing avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.