title: Android, How to extract system apps and perform some checks
body: <p>I have list of appName in an array, I require a list of system apps + installed app and then need to compare it with each app in appName, if any app from list of system apps + installed is match with app from appName, then we need to check their version if different then make some action.</p>
  
  <p>I have started by writing below codes:</p>
  
  <pre><code>private List&lt;ApplicationInfo&gt; getInstallapp(){
  
      final PackageManager pm = context.getPackageManager();
  
      List&lt;ApplicationInfo&gt; installedApps;
      try {
          installedApps = pm.getInstalledApplications(0);
          pm.getPackageInfo(getPackageName(),0);
      } catch (final PackageManager.NameNotFoundException e) {
          installedApps = null;
      }
  
      for(int i=0; i&lt;installedApps.size();i++){
          Log.d("Apps", "Apps are: "+installedApps.get(i).toString());
      }
      Log.d("System apps", "System apps are: " +installedApps);
      return installedApps;
  }
  </code></pre>
  
  <p>but now I am stuck because I am getting each apps in below format</p>
  
  <pre><code>ApplicationInfo{53a4a03 com.android.providers.contacts}
  </code></pre>
  
  <p>How can I get version no. of each app and also each app of string format, so that I can compare it with my app in a list.</p>
  
  <p>Please help me to move forward.</p>