title: How to send data to servlet from android application in android studio?
body: <p>I want to send data from my android app to servlet.
  i was trying to use this in my app :</p>
  
  <pre><code>    private boolean postData(String s) {
      HttpClient httpclient = new DefaultHttpClient();
  
      HttpPost httppost = new HttpPost(s); // s is my url
  
      try {
  
          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
          nameValuePairs.add(new BasicNameValuePair("id", "1003"));
          nameValuePairs.add(new BasicNameValuePair("name", "Anil"));
          nameValuePairs.add(new BasicNameValuePair("loc", "Kalyan"));
          httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
          HttpResponse response = httpclient.execute(httppost);
      }  catch (Exception e) {
          // TODO Auto-generated catch block
          return false;
      }
      return true;
  }
  </code></pre>
  
  <p>I was this method but was not able to import these files :</p>
  
  <pre><code>    import org.apache.http.client.methods.HttpPost;
      import org.apache.http.impl.client.DefaultHttpClient;
      import org.apache.http.client.HttpClient;
  import org.apache.http.client.entity.UrlEncodedFormEntity;
  </code></pre>
  
  <p>How to impoert these files in android studio?? Or else is there any other method to do so??  Thanx in advance</p>