• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps get app's permissions

hi

i want to make an application that contains a list of installed application and onClick in any application return application permission.

Code:
String appName;
List<PackageInfo> packs = getPackageManager().getInstalledPackages(0);
for(int i=0;i<packs.size();i++) {
     PackageInfo p = packs.get(i);
     if ((p.versionName == null)) 
           {
                continue ;
            }
appName  = p.applicationInfo.loadLabel(getPackageManager()).toString();
Drawable icon = p.applicationInfo.loadIcon(getPackageManager());
            
Log.d("aaaaaa", "Installed package :" + appName +  "" );
Log.d("dddddd", "Launch Program Icon :"+ icon + "");

this code to get the application name and it's icon and i want return the permissions


help me pls :)
This is home work
 
Your homework was to ask how to do this in a forum? ;)

Here's a hint, you are pretty close to the solution already, just check out the members of the class PackageInfo which you are iterating though.
 
Your homework was to ask how to do this in a forum? ;)

Here's a hint, you are pretty close to the solution already, just check out the members of the class PackageInfo which you are iterating though.

I try many time but I don't know how to do it. :mad: :)

ok I will check class PackageInfo but if I can't do it, you will help me :D


Thank You :)
 
Back
Top Bottom