title: How to programmatically get the installed game list in Android
body: <p>In my project I can get the list of all installed application by the following code:</p>
  
  <pre><code>public class ApplicationFilterActivity extends Activity implements
          OnItemClickListener {
  
      ListView appfilter;
      SharedPreferences preferences;
      public static String filenames = "RotateData";
  PackageManager pck;
      ArrayList&lt;Applications&gt; results = new ArrayList&lt;Applications&gt;();
      ArrayList&lt;String&gt; gotPackagename = new ArrayList&lt;String&gt;();
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          appfilter = (ListView) findViewById(R.id.lvApp);
          preferences = getSharedPreferences(filenames, 0);
          PackageManager packageManager = this.getPackageManager();
          List&lt;PackageInfo&gt; applist = packageManager.getInstalledPackages(0);
          Iterator&lt;PackageInfo&gt; it = applist.iterator();
          while (it.hasNext()) {
              PackageInfo pk = (PackageInfo) it.next();
              results.add(new Applications(pk.applicationInfo
                      .loadIcon(packageManager), ""
                      + pk.applicationInfo.loadLabel(packageManager)));
              Log.i("AppName", "" + pk.applicationInfo.packageName);
              gotPackagename.add(pk.applicationInfo.packageName);
          }
  
          appfilter.setAdapter(new Customarrayadapter(this, results));
          appfilter.setOnItemClickListener(this);
      }
  }
  </code></pre>
  
  <p>but now I want to filter that the list will show only the games , is it possible?</p>