How to get application resolution settings in android?

I am developing a small application that lists only those applications that connect to the Internet. How can I read the Android manifest file from the Packageinfo class to access the permission settings for each application programmatically?

private void getWebApps() { // TODO Auto-generated method stub PackageManager packageManager=this.getPackageManager(); List<PackageInfo> applist=packageManager.getInstalledPackages(0); Iterator<PackageInfo> it=applist.iterator(); while(it.hasNext()){ PackageInfo pk=(PackageInfo)it.next(); String appname=pk.applicationInfo.loadLabel(packageManager).toString(); installedapplist.add(appname); } 

In the code above, “installedapplist” is an array that stores the names of applications. But before adding to the list, I need to check only those applications that access the Internet. Can someone help me how to check permission?

+4
source share
2 answers

You can use -

 getPackageManager().getInstalledPackages(PackageManager.GET_PERMISSIONS); 

Returns an array of permissions. You can then iterate over it and check if the Internet exists.

+7
source

You can easily find this in the docs .

+2
source

All Articles