转载 https://blog.csdn.net/sanlei1616/article/details/41545257/
//获取费系统app的apk方法:
List<PackageInfo> packages = getPackageManager().getInstalledPackages(0);
for(int i=0;i<packages.size();i++) {
PackageInfo packageInfo = packages.get(i);
if((packageInfo.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM)==0)
{
//非系统应用
String appName = packageInfo.applicationInfo.loadLabel(getPackageManager()).toString();
String packageName = packageInfo.packageName;
String versionName = packageInfo.versionName;
int versionCode = packageInfo.versionCode;
BitmapDrawable bd = (BitmapDrawable)
packageInfo.applicationInfo.loadIcon(getPackageManager());
Bitmap appIcon = bd.getBitmap();
String sourceDir = packageInfo.applicationInfo.sourceDir; // /data/app/com.sina.weibo-1.apk
}
}