什么是Android市场或谷歌企业应用套件的包名 [英] What is the package name of the Android Market or Google Apps

查看:208
本文介绍了什么是Android市场或谷歌企业应用套件的包名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查是否在Android Market安装这样

I need to check if the Android Market is installed like this

    /*
     * Test for existence of Android Market
     */
    boolean androidMarketExists = false;
    try{
        ApplicationInfo info = getPackageManager()
                             .getApplicationInfo("com.google.process.gapps", 0 );
        //application exists
        androidMarketExists = true;
    } catch( PackageManager.NameNotFoundException e ){
        //application doesn't exist
        androidMarketExists = false;
    }

但我不知道是否com.google.process.gapps是具有安卓市场或包装不。

But I don't know if com.google.process.gapps is the package that has android market or not.

推荐答案

它com.android.vending(在我的Galaxy S),这里是更好的办法,找出...通过查询谁处理市场:// URI的。

It's com.android.vending (on my Galaxy S), and here's the better way to find out... by querying for who handles market:// URIs.

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://search?q=foo"));
    PackageManager pm = getPackageManager();
    List<ResolveInfo> list = pm.queryIntentActivities(intent, 0);

如果该列表具有至少一个条目,该市场的存在。

If the list has at least one entry, the Market's there.

这篇关于什么是Android市场或谷歌企业应用套件的包名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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