Cómo instalar todas las aplicaciones en el teléfono Android

Este es el código que tengo en este momento, pero todavía no puedo obtener una lista de todas las aplicaciones en el teléfono. ¿Alguien ve lo que estoy haciendo mal?

public class GetAppList extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        try {
            List<PackageInfo> appListInfo1 = this.getPackageManager()
            .getInstalledPackages(0);
            JSONArray ja = new JSONArray();
            try {
                HttpClient httpclient = new DefaultHttpClient();
                Object sendDataUrl = null;
                HttpPost request = new HttpPost(sendDataUrl.toString());
                List<NameValuePair> params = new ArrayList<NameValuePair>();
                ContextWrapper context = null;
                PackageManager pm = context.getPackageManager();
                List<PackageInfo> appListInfo = pm.getInstalledPackages(0);
                for (PackageInfo p : appListInfo) {
                    if (p.applicationInfo.uid > 10000) {
                        JSONObject jo = new JSONObject();
                        jo.put("label", p.applicationInfo.loadLabel(pm).toString());
                        jo.put("packageName", p.applicationInfo.packageName);
                        ja.put(jo);
                    }
                    System.out.print(ja);
                }        
        } catch (Exception e) {
            // TODO: handle exception
        }
        finally {
            // ... cleanup that will execute whether or not an error occurred ...
        }



}catch (Exception e) {
    // TODO: handle exception
}
finally {
    // ... cleanup that will execute whether or not an error occurred ...
}
    }}

Lo siento, no puedo obtener esto para formatear el código correctamente.

Respuestas a la pregunta(2)

Su respuesta a la pregunta