GithubHelp home page GithubHelp logo

basirsharif / downloadmanager-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from n4nabil/downloadmanager

0.0 0.0 0.0 126 KB

Demo app Download single/multiple files using Download Manager in Android

Kotlin 100.00%

downloadmanager-2's Introduction

Download Manager

Demo app Download single/multiple files using Download Manager in Android

Download Manager is a system service which allows to handle long-running HTTP downloads in the background and notify the triggering application via a broadcast receiver once the download is finished. It was introduced in Android 2.3. (API 9).

Download manager helps use reduce the burden of writing our own download service with all those error handling. In this tutorial we will see how to create a download manager to download a file in background and notify the application once the file is downloaded.

Single Download File

We are passing a request to the Download Manager with the download file URL, Title and Description to be shown in notification bar etc. We can also specify whether the download should happen over wifi or cellular or both.

Multiple file Downloads

Downloading multiple files is easy. just need to add the above request in a loop. The download requests will be added into the queue. I am using a single download url in the loop. You may use multiple urls depending on your requirements by adding it in a list and iterating it.

Listening to Download Complete

You may listen when a download is completed and perform some actions like showing a download completed notification. In order to do that you need to keep a track of the refid that we get while enqueuing the download requests. After every enqueue add the refid into an Array list.

downloadmanager-2's People

Contributors

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