title: How to show Android applications are installed by user to a listview?
body: <p>I'm writing a application like task manager. I wonder how to show Android applications are installed by user to a listview, everybody please help me</p>
  
  <p>I just did some function like this to manage apps in Android, the code is Ok but I wanna add more functions</p>
  
  <pre><code>public void onClick(View v) {
      // TODO Auto-generated method stub
      switch (v.getId()) {
      case R.id.appinfo:
          final ActivityManager actvityManager = (ActivityManager) this.getSystemService( ACTIVITY_SERVICE );
  
             List&lt;RunningAppProcessInfo&gt; procInfos = actvityManager.getRunningAppProcesses();
  
  
              for(int i = 0; i &lt; procInfos.size(); i++)
  
              {
  
                      tv.setText(tv.getText().toString()+procInfos.get(i).processName+
  
                                  " " + String.valueOf(procInfos.get(i).processName.length())+"\n");
  
                      if(procInfos.get(i).processName.equals("com.android.camera")) {
  
                          Toast.makeText(getApplicationContext(), "Camera App is running", Toast.LENGTH_LONG).show();
  
                      }
                      else{
                          Toast.makeText(getApplicationContext(), "Camera App is not running", Toast.LENGTH_LONG).show();
                      }
  
              }
  
          break;
  
      case R.id.taskinfo:
           final   ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
           final List&lt;RunningTaskInfo&gt; recentTasks = activityManager.getRunningTasks(Integer.MAX_VALUE);
  
            for (int i = 0; i &lt; recentTasks.size(); i++) 
              {
                 tv.setText("Executed app"+ "Application executed : " +recentTasks.get(i).baseActivity.toShortString()+ "\t\t ID: "+recentTasks.get(i).id+"");         
              }
  
            break;
  
      case R.id.serviceinfo:
          final String APP_TAG = "tag";
  
          ActivityManager activityManager1 = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
          List&lt;ActivityManager.RunningServiceInfo&gt;runningServices = activityManager1.getRunningServices(50);
  
          for (int i = 0;i &lt; runningServices.size();i++){
  
              ActivityManager.RunningServiceInfo runningServiceInfo = runningServices.get(i);
  
              tv.setText(APP_TAG + "Process " + runningServiceInfo.process + " with component " + runningServiceInfo.service.getClassName());
  
          }
  </code></pre>