android 获取设备上安装的非系统应用信息

		            ArrayList appList = new ArrayList(); //用来存储获取的应用信息数据     
			    List packages = getPackageManager().getInstalledPackages(0);  
		            for(int i=0;i
                                                        tmpInfo.appName = packageInfo.applicationInfo.loadLabel(getPackageManager()).toString();   
		            tmpInfo.packageName = packageInfo.packageName;   
		            tmpInfo.versionName = packageInfo.versionName;   
		            tmpInfo.versionCode = packageInfo.versionCode;   
		            tmpInfo.appIcon = packageInfo.applicationInfo.loadIcon(getPackageManager());  
  			    if((packageInfo.applicationInfo.flags&ApplicationInfo.FLAG_SYSTEM)==0)  
		            {  tmpInfo.print();
		                appList.add(tmpInfo);//如果非系统应用,则添加至appList  
		            }  

    public class AppInfo {  
    public String appName="";  
    public String packageName="";  
    public String versionName="";  
    public int versionCode=0;  
    public Drawable appIcon=null;  }

你可能感兴趣的:(android)