查看Android手机中是否安装了某个应用

  List<PackageInfo> list = getPackageManager().getInstalledPackages(PackageManager.GET_PERMISSIONS);  
          
        StringBuilder stringBuilder = new StringBuilder();  
  
        for (PackageInfo packageInfo : list) {  
             stringBuilder.append("package name:"+ packageInfo.packageName + "\n");  
             ApplicationInfo applicationInfo = packageInfo.applicationInfo;  
             stringBuilder.append("应用名称:"+ applicationInfo.loadLabel(getPackageManager())  
                 + "\n");  
             if (packageInfo.permissions != null) {  
      
                    for (PermissionInfo p : packageInfo.permissions) {  
                     stringBuilder.append("权限包括:" + p.name + "\n");  
                    }  
             }  
             stringBuilder.append("\n");  

你可能感兴趣的:(查看Android手机中是否安装了某个应用)