title: Not getting the response
body: <p>i am creating a application in which i send some parameters to my web service right now it is running on local host and it gives me json response. Somehow it is not working after this line <strong>HttpResponse httpResponse = httpClient.execute(httpPost);</strong>. Can anyone help please.
  ps. my webservice is working absolutely fine   </p>
  
  <p>test_class.java</p>
  
  <pre><code>package com.vitarkasolutions.tracker;
  
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.InputStreamReader;
  import java.io.Reader;
  import java.io.UnsupportedEncodingException;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.HttpStatus;
  import org.apache.http.NameValuePair;
  import org.apache.http.client.ClientProtocolException;
  import org.apache.http.client.entity.UrlEncodedFormEntity;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.message.BasicNameValuePair;
  
  import android.app.Activity;
  import android.os.AsyncTask;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  
  import com.google.gson.Gson;
  
  
  public class test_class extends Activity{
      final static String url = "http://10.0.2.2/tracker/index.php" ;
      String xyz ="";
      String tag ="login";    
      String name="varun";
      String email="varun@gmail.com";
      int lat= 10;
      int lang = 20;
      int phone_no= 10;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.test);
       Button btn = (Button)findViewById(R.id.button1);   
       btn.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              registerUser(name, email, tag, phone_no, lat, lang);    
          }
      });
  
      }
  
  @SuppressWarnings("unchecked")
  public void registerUser(String name, String email,String register_tag, int phone_no ,int lat , int lang )
  {
  
              // Building Parameters
              List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;();
              params.add(new BasicNameValuePair("tag", register_tag));
              params.add(new BasicNameValuePair("name", name));
              params.add(new BasicNameValuePair("email", email));
              params.add(new BasicNameValuePair("phone_no",String.valueOf(phone_no)));
              params.add(new BasicNameValuePair("lat",String.valueOf(lat) ));
              params.add(new BasicNameValuePair("lang", String.valueOf(lang)));
  
              try {
              parsing data = new parsing();
              data.execute(params);
                  //AsyncTask parsing =new parsing().execute(params);
              } catch (IllegalStateException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
  
  
          }
  
  
  public  class parsing extends AsyncTask&lt;List&lt;? extends NameValuePair&gt;, Void, Void&gt; {    
      // Making HTTP request
  
      @Override
      protected Void doInBackground(List&lt;? extends NameValuePair&gt;... params) {
          // TODO Auto-generated method stub
           Log.e("tag", "parse function called");            
          try{
                  // defaultHttpClient
           DefaultHttpClient httpClient = new DefaultHttpClient();
          HttpPost httpPost = new HttpPost(url);
          Log.d("tag", "post");
          httpPost.setEntity(new UrlEncodedFormEntity(params[0]));    
          Log.d("tag", "entity");
          HttpResponse httpResponse = httpClient.execute(httpPost);                   
          Log.d("tag", "response");
          final int statusCode = httpResponse.getStatusLine().getStatusCode();
  
                  if (statusCode != HttpStatus.SC_OK) 
                  { 
                      Log.w(getClass().getSimpleName(), "Error " + statusCode + " for URL " + url); 
                      Log.d("not Connected", "connected");
                  }else{
                      Log.d("Connected", "connected");
                  }
                  Log.d("Con", "connected");
                  HttpEntity httpEntity = httpResponse.getEntity();                                               
                 InputStream is = httpEntity.getContent();       
                 Reader Reader = new InputStreamReader(is);
                   Log.e("tag2", is.toString());         
                   Gson gson = new Gson();                             
                   user user = gson.fromJson(Reader,user.class);   
                   Log.e("tag3", "done");
                   Log.e("tag4", user.toString());
                   Log.e("tag4", user.name);
                   Log.d("tag4", user.email);
  
          } 
          catch  (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return null;
  
  }       
  }
  
  }
  </code></pre>