问题
I want to read permission of other applications installed in my android mobile using programming.
I think Android Cleaner read permission of other apps and display details like
I want get detail like this Image.
In this it's give details of Ad Network
How i get details like this app in my app?
If this app not Read Permission then How it's do it?
回答1:
Well you can scrape the playstore app page for a given app and get the permissions it needs :)
Well that's just off the top of my head. On a serious note, you can do the following:
Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List appsList = getPackageManager().queryIntentActivities(intent, 0);
for (Object app : appsList) {
ResolveInfo resolveInfo = (ResolveInfo) app;
PackageInfo packageInfo = null;
try {
packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, PackageManager.GET_PERMISSIONS);
} catch (NameNotFoundException ex) {
ex.printStackTrace();
}
String[] requestedPermissions = packageInfo.requestedPermissions;
}
来源:https://stackoverflow.com/questions/25244456/read-permission-of-installed-application-in-android-phone