3

I want a create custom download Manager in which I need to show all downloading file status in another activity.

I Have an Activity in which there is listing of different file and when I tab on the ListView.

Downoading will start in the BACKGROUND and I have a other activity in which all the downloading file status will be visible like as Image what I attach:

enter image description here

I read Downloadmanager Class and AsyncTask for achieving this functionality and could not resolve.

How to achieve more than one downloading in the background and when I open the Downloding.java (Download Activity). All the downloading will appear

Can somebody suggest me How to do this thing or suggest me the other way to start working on it?

Akarsh M
  • 1,629
  • 2
  • 24
  • 47

1 Answers1

1

DownloadManager is the right direction.

  • You can add a new doanload by using enqueue
  • You can update your Gui by querying regularly the DownloadManager to know the status of each of your downloads.
  • You can cancel one of the requested downloads with the cancel method (as your GUI seems to provide a button for that)
  • You also want to register a broadcast receiver to be informed when a download is finished even if your Activity is not displayed at that time.

The number of thread used by the DownloadManager, and hence the number of parallel downloads, is managed automatically by the framework.

Pierre Rust
  • 2,474
  • 18
  • 15
  • Thanks for the reply. I saw your process and ASAP making a demo on this basis. :) – Akarsh M Feb 14 '14 at 13:37
  • I checked the way , you wrote earlier but having an issue. I have no way to pause the downloading. Could you suggest me. What i Missed from the documentation ? – Akarsh M Feb 15 '14 at 09:40
  • I'm afraid you haven't missed anything, there is no pause functionality in the DownloadManager. If you really need this functionality, you will have to develop your own DownloadManager implementation (these answers may help a bit : http://stackoverflow.com/questions/11297298/downloadmanager-with-manually-pause-and-resume and http://stackoverflow.com/questions/6237079/resume-http-file-download-in-java). And keep in mind that you also need resume support on the server side ! – Pierre Rust Feb 18 '14 at 10:00