title: Get the name, icon and package name of all the installed applications in android
body: <p>I want to be able to get the string package name and icon of all the applications installed in my phone. 
  What I have done:
  Browsed and found this solution</p>
  
  <pre><code>final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); 
              mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); 
              final List pkgAppsList = this.getPackageManager().queryIntentActivities(mainIntent, 0);
              for(int counter = 0; counter&lt;=pkgAppsList.size()-1;counter++)
              {
                      Log.e("TAG", pkgAppsList.get(counter).toString());
    } 
  </code></pre>
  
  <p>The problem is that it displays package and class name as as a as a mix and I can't get the icon. What I want is to show the user a list of all the applications installed on the phone with the icon. And I also need to be able to get the package name with a <code>List.OnItemClickListener</code>. I assume that using an array of app names and package name which are of same positioning I can do that. But how would I get the app icon and name with package name. Preferably as an Array or ArrayList that I can convert into a listView object. If there is any alternative method even let me know. I am still a beginner in Android.</p>
  
  <p>And please do help.</p>