简体   繁体   English

如何阅读iOS上安装的所有应用程序的列表

[英]How to read list of all apps installed on iOS

Twitter is all over the news about wanting to collect a list of all apps installed on users iOS and Android. Twitter遍地都是有关希望收集用户iOS和Android上安装的所有应用程序列表的新闻。

Is there any recent API I'm no aware off that allows them to do that? 我最近不知道有没有允许他们这样做的API? or are they scanning app url schemes registered? 还是他们正在扫描注册的应用程序网址方案?

If you want to get the list of installed apps in android you can use this: 如果要获取android中已安装应用程序的列表,可以使用以下命令:

/**
 * Returns a list of installed apps
 */
public static ArrayList<PackageInformation> getInstalledApps(
        Context contxt, boolean getSysPackages) {
    ArrayList<PackageInformation> pacakgeInformationList = new ArrayList<PackageInformation>();
    List<PackageInfo> packs = contxt.getPackageManager()
            .getInstalledPackages(0);

    for (int i = 0; i < packs.size(); i++) {
        PackageInfo packageInfo = packs.get(i);
        if ((!getSysPackages)) {
            continue;
        }
        PackageInformation newInfo = new PackageInformation();
        newInfo.setAppName(packageInfo.applicationInfo.loadLabel(
                contxt.getPackageManager()).toString());
        newInfo.setPacakgeName(packageInfo.packageName);
        newInfo.setVersionName(packageInfo.versionName);
        newInfo.setVersionCode(packageInfo.versionCode);
        newInfo.setIcon(packageInfo.applicationInfo.loadIcon(contxt
                .getPackageManager()));
        pacakgeInformationList.add(newInfo);
    }
    return pacakgeInformationList;
}

and after that you just need permission to access to the internet and then easily send what information you want to what server you want. 然后,您只需要访问互联网的权限,然后轻松地将所需的信息发送到所需的服务器即可。

So unfotunatley YES, it's possible to do that in android. 所以unfotunatley是的,有可能在android中做到这一点。

And for ios please see this post: Get list of all installed apps 对于ios,请参阅这篇文章: 获取所有已安装应用程序的列表

They said without jailbroken iPhones you can not do this. 他们说,没有越狱的iPhone,您将无法做到这一点。

Piece of code will bring you all the list of activities/applications installed on Android : 一段代码将带给您所有安装在Android上的活动/应用程序的列表:

final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = context.getPackageManager().queryIntentActivities( mainIntent, 0);

for more information, take a look: How to get a list of installed android applications and pick one to run 有关更多信息,请看一下: 如何获取已安装的android应用程序列表并选择一个要运行的应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM