3

In my application, I need to know if a particular app is being downloaded from the android market or not. How Do I achieve this functionality? Is it possible to get a list of all the downloads that are in progress?Does the android market broadcast any intents that can be caught?

Note:Since my target application is on android 3.0+ devices therefore, I have no issues with using the DownloadManager class(which is 2.3 onwards).

Amol Gupta
  • 704
  • 1
  • 8
  • 26
  • This [link][1] may be help full. [1]: http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run – Suresh Kerai Aug 09 '11 at 05:59
  • Actually,I am looking for the list of apps being downloaded currently not the ones installed. – Amol Gupta Aug 09 '11 at 06:18

2 Answers2

1

I found an API that will accomplish what you want but you need to have an API of 9 or higher to use it. You can get all the downloads that have been requested for download from a download manager by using this:

DownloadManager manager = (DownloadManager)getSystemService(Context.DOWNLOAD_SERVICE);
DownloadManager.Query query = new DownloadManager.Query();
Cursor c = manager.query(query);

You can get more information on this here. I don't think there are any other methods available that will give you this information at a lower API level.

A. Abiri
  • 10,750
  • 4
  • 30
  • 31
  • Note that Market using the download manager is purely an implementation detail. You definitely should not assume whatever you see in there will have any relationship to what Market may be doing. – hackbod Aug 16 '11 at 01:41
0

I dont think that there are any android market application intents you can catch (but I'm not 100% sure because I can't find android market app manifest nowhere).

As I see it, through the DownloadManager.query(DownloadManager.Query q) class you should be able to find all the ongoing downloads and by source of the data you could exclude all which are not download from market.

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
Indrek Kõue
  • 6,449
  • 8
  • 37
  • 69