有什么办法可以在Android上访问已安装的应用列表?他们在安装时使用了什么许可/或者他们现在有什么许可?
答案 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
}
}
}
}