Giter VIP home page Giter VIP logo

downloaddemo's Introduction

OKDownload parallel Demo

基于OkDownload框架的并行多任务下载Demo

OkDownload是一个非常强大的下载库,对单个任务的支持非常好,同时也支持多任务串行下载, 但是对于多任务并行,并没有给出相关的队列。

但是OkDownload本身就是一个多任务并行下载的集合,只不过我们如果要使用还需要在其基础上在封装一层我们自己的任务队列和数据库去方便管理我们的任务。

这个Demo非常简单,就是在他的基础上去实现一个并行多任务下载的功能。

以下是大致思路:

首先定义三个队列分别存放OkDownload的Task,自定义的Task,和下载完的Task,后两者基本是为界面展示准备的,因为Okdownload自带参数非常少,不够支持界面所需的数据。接下来就只要管理好各个状态和各个操作后三个队列中的数据就可以了.将下载任务统一运行在Service中,所有任务都用同一个接口回调, 实时进度和状态都通过Eventbus传递到Activity中,刷新数据即可。

downloaddemo's People

Contributors

sunheihei avatar

Stargazers

revstar avatar

Watchers

James Cloos avatar  avatar

downloaddemo's Issues

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.