如何获取应用程序被下载列表? [英] how to Get a list of applications being download?

查看:147
本文介绍了如何获取应用程序被下载列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我需要知道,如果一个特定的应用程序被从Android Market下载与否。我该如何实现这个功能?是否有可能获得所有正在进行的下载列表?是否在Android Market广播,可以捕获任何意图?

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?

注:由于我的目标应用是在Android 3.0+设备,因此,我使用的下载管理器类(2.3起)没有问题

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

推荐答案

我发现了一个API,将完成你想要什么,但你需要有9或更高的API来使用它。你可以得到所有已请求下载一个下载管理使用此下载:

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);

您可以在此这里更多信息。我不认为有可用的,这将使你这些信息在一个较低的API级别的任何其他方法。

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.

这篇关于如何获取应用程序被下载列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆