0

is there any way to know through code what are all download requests I made in past and their download status. i.e simply I want to know download history. Note: Download requests can be made from browser or from any other apps Thanks in Advance

Edit

himanshu solution is giving download request made from my app but not from browser or other apps. Can anybody provide some more help.

Ganesh K
  • 2,623
  • 9
  • 51
  • 78

1 Answers1

2

You should read the following documentation about DOWNLOADMANAGER...

http://developer.android.com/reference/android/app/DownloadManager.html

and i also got a constant ACTION_VIEW_DOWNLOADS which launchs an activity to display all downloads in the above doc.

http://developer.android.com/reference/android/app/DownloadManager.html#ACTION_VIEW_DOWNLOADS

EDIT

DownloadManager.Query query = null;
downloadManager = (DownloadManager)getSystemService(DOWNLOAD_SERVICE);
query = new DownloadManager.Query();
query.setFilterByStatus(DownloadManager.STATUS_FAILED|DownloadManager.STATUS_PENDING|DownloadManager.STATUS_RUNNING|DownloadManager.STATUS_SUCCESSFUL);

With the help of the above code you can show download history from your app.

himanshu
  • 1,990
  • 3
  • 18
  • 36
  • @himashu Tx for u links. What I want is From my app, I want show download history not from other apps or intents means actually searching for a way to query download manager database and getting the history – Ganesh K Feb 08 '12 at 09:33
  • There's one more constant ACTION_VIEW_DOWNLOADS.Try this and let me know the result,I hope this will help you. – himanshu Feb 08 '12 at 11:32
  • Sry I forgot to vote up. Once again tx for ur quick responses. – Ganesh K Feb 08 '12 at 12:05