Android HttpPost: How to get the result


I have been trying long to send an HttpPost request and retrieve response but even though I was able to make a connection I don't yet get how to get the string message which is returned by the request-response

 HttpClient httpclient = new DefaultHttpClient();
 HttpPost httppost = new HttpPost("");
 // Add your data
 List < NameValuePair > nameValuePairs = new ArrayList < NameValuePair > (5);
 nameValuePairs.add(new BasicNameValuePair("type", "20"));
 nameValuePairs.add(new BasicNameValuePair("mob", "919895865899"));
 nameValuePairs.add(new BasicNameValuePair("pack", "0"));
 nameValuePairs.add(new BasicNameValuePair("exchk", "1"));

 try {
     httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
     Log.d("myapp", "works till here. 2");
     try {
         HttpResponse response = httpclient.execute(httppost);
         Log.d("myapp", "response " + response.getEntity());
     } catch (ClientProtocolException e) {
     } catch (IOException e) {
 } catch (UnsupportedEncodingException e) {

I'm sorry, I sound very naive because I'm new to java. Please help me.

Try to use the EntityUtil on your response:

String responseBody = EntityUtils.toString(response.getEntity());