How to get the List of Installed Applications in Android?
<p>This is the source code...</p>

<pre><code>public class GetAppList extends Activity {    
    @Override
    public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try {
        List&lt;PackageInfo&gt; appListInfo = this.getPackageManager()
        .getInstalledPackages(0);
        JSONArray ja = new JSONArray();
        for (PackageInfo p : appListInfo) {
            if (p.applicationInfo.uid &gt; 10000) {
                JSONObject jo = new JSONObject();
                jo.put("label", p.applicationInfo.name);
                jo.put("packageName", p.applicationInfo.packageName);
                ja.put(jo);
            }


        }
        System.out.println(ja);
    } catch (Exception e) {
        // TODO: handle exception
    }

    }
}
</code></pre>

<p>this is the result~</p>

<p>[{"packageName":"com.android.soundrecorder"},{"packageName":"com.android.alarmclock"},{"packageName":"com.android.sdksetup"},{"packageName":"com.android.launcher"},{"packageName":"com.google.android.providers.enhancedgooglesearch"},{"packageName":"com.gameloft.android.ANMP.GloftAsphalt5.asphalt5"},{"packageName":"com.android.contacts"},{"packageName":"com.zhang7nan.android"},{"packageName":"com.android.inputmethod.latin"},{"packageName":"irdc.ex03_19"},{"packageName":"com.android.calculator2"},{"packageName":"com.zhang7nan.getAppList"},{"packageName":"com.android.htmlviewer"},{"packageName":"com.androidbook.layout"},{"packageName":"irdc.EX05_04"},{"packageName":"com.android.browser"},{"packageName":"com.android.customlocale"},{"packageName":"com.android.music"},{"packageName":"com.android.netspeed"},{"packageName":"com.android.providers.userdictionary"},{"packageName":"com.android.inputmethod.pinyin"},{"packageName":"android.tts"},{"packageName":"com.android.providers.media"},{"packageName":"com.android.globalsearch"},{"packageName":"com.wd.AndroidDaemon"},{"packageName":"com.android.fallback"},{"packageName":"com.gameloft.android.GAND.GloftBia2.bia2"},{"packageName":"com.android.gesture.builder"},{"packageName":"org.lee.android"},{"packageName":"android.tether"},{"packageName":"com.android.providers.contacts"},{"packageName":"com.android.providers.applications"},{"packageName":"com.android.providers.drm"},{"packageName":"com.android.term"},{"packageName":"com.android.development"},{"packageName":"com.android.packageinstaller"},{"packageName":"com.svox.pico"},{"packageName":"com.android.camera"},{"packageName":"jp.co.omronsoft.openwnn"},{"packageName":"com.android.email"},{"packageName":"com.wandoujia.wandouapp"},{"packageName":"com.android.spare_parts"},{"packageName":"com.android.providers.downloads"}]</p>

<p>app name does not exist!help!</p>
