private void getAPKNAME() {
packageManager = getPackageManager();
List<PackageInfo> packageList = packageManager
.getInstalledPackages(PackageManager.GET_PERMISSIONS);
Log.e("packageList", "" + packageList.size());
List<PackageInfo> packageList1 = new ArrayList<PackageInfo>();
/*To filter out System apps*/
for(PackageInfo pi : packageList) {
boolean b = isSystemPackage(pi);
if(!b) {
packageList1.add(pi);
// errorText.setText(""+pi);
}
}
Log.e("PackageList",""+packageList1.size());
}
private boolean isSystemPackage(PackageInfo pkgInfo) {
return ((pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) ? true
: false;
}
packageManager = getPackageManager();
List<PackageInfo> packageList = packageManager
.getInstalledPackages(PackageManager.GET_PERMISSIONS);
Log.e("packageList", "" + packageList.size());
List<PackageInfo> packageList1 = new ArrayList<PackageInfo>();
/*To filter out System apps*/
for(PackageInfo pi : packageList) {
boolean b = isSystemPackage(pi);
if(!b) {
packageList1.add(pi);
// errorText.setText(""+pi);
}
}
Log.e("PackageList",""+packageList1.size());
}
private boolean isSystemPackage(PackageInfo pkgInfo) {
return ((pkgInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) ? true
: false;
}
No comments:
Post a Comment