fbpx
Pages Navigation Menu

Coding is much easier than you think

To find list of permissions used by an installed application in android

To find list of permissions used by an installed application in android

The below code not only retrieves the permission  , but will also retrieve services , receivers . Be  careful on PackageManager tags. This will only fetch you the corresponding information on specific packages .

 

PackageManager p = this.getPackageManager();
  final List < PackageInfo>; appinstall=p.getInstalledPackages(PackageManager.GET_PERMISSIONS|PackageManager.GET_RECEIVERS|
      PackageManager.GET_SERVICES|PackageManager.GET_PROVIDERS);

  for(PackageInfo pInfo:appinstall){
      //PermissionInfo[] permission=pInfo.permissions;
       String[] reqPermission=pInfo.requestedPermissions;
       ServiceInfo[] services=pInfo.services;
       ProviderInfo[] providers=pInfo.providers;

  int versionCode=pInfo.versionCode;
  Log.d("versionCode-package ",Integer.toString(versionCode));
  Log.d("Installed Applications", pInfo.applicationInfo
            .loadLabel(pm).toString());
  Log.d("packegename",pInfo.packageName.
           toString());
  if(reqPermission!=null)
    for(int i=0;i < reqPermission.length;i++)
       Log.d("permission list",reqPermission[i]);

 

About Gokul


I am very much interested in android and Wicket framework. A core android developer and working in android native app development and responsive web mobile design. I have also worked in wicket fame work and java web development. I will keep on updating you about android and wicket framework and answer your query.

Advertisements
%d bloggers like this: