访问已安装应用的列表

时间:2012-11-15 04:21:34

标签: android

  

可能重复:
  How to get installed applications permissions

有什么办法可以在Android上访问已安装的应用列表?他们在安装时使用了什么许可/或者他们现在有什么许可?

2 个答案:

答案 0 :(得分:0)

final List<PackageInfo> list = getPackageManager().getInstalledPackages(0);
for (final PackageInfo pack : list)
{
    Log.i("Packages", pack.packageName);
}

答案 1 :(得分:0)

 final PackageManager pm = context.getPackageManager();
        List<PackageInfo> packageInfo = pm.getInstalledPackages(PackageManager.GET_PERMISSIONS);

        for (PackageInfo info : packageInfo) {
            String[] requestedPermissions = info.requestedPermissions;
            if (requestedPermissions != null) {
                for (String permission : requestedPermissions) {
            if ("your_manifest_permission".equals(permission)) {
                        Do Something

}
}
}
        }