title: Autofill a form of a website with input data of an android app
body: <p>I'm new in android developers and I search a lot through the internet, I found a solution for sending data to website but since most of the command deprecated I don't know how to do this. 
  I want to fill a website form (like login form) by interaction with my android app and send data to it. (using urlconnection).
  here is some parts of the deprecated code:
    HttpClient httpClient = new DefaultHttpClient();</p>
  
  <pre><code>            // In a POST request, we don't pass the values in the URL.
              //Therefore we use only the web page URL as the parameter of the HttpPost argument
              HttpPost httpPost = new HttpPost("http://my2film7.in/");
  
              // Because we are not passing values over the URL, we should have a mechanism to pass the values that can be
              //uniquely separate by the other end.
              //To achieve that we use BasicNameValuePair
              //Things we need to pass with the POST request
              BasicNameValuePair usernameBasicNameValuePair = new BasicNameValuePair("paramUsername", paramUsername);
              BasicNameValuePair passwordBasicNameValuePAir = new BasicNameValuePair("paramPassword", paramPassword);
  
              // We add the content that we want to pass with the POST request to as name-value pairs
              //Now we put those sending details to an ArrayList with type safe of NameValuePair
              List&lt;NameValuePair&gt; nameValuePairList = new ArrayList&lt;NameValuePair&gt;();
              nameValuePairList.add(usernameBasicNameValuePair);
              nameValuePairList.add(passwordBasicNameValuePAir);
  
              try {
                  // UrlEncodedFormEntity is an entity composed of a list of url-encoded pairs.
                  //This is typically useful while sending an HTTP POST request.
                  UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(nameValuePairList);
  
                  // setEntity() hands the entity (here it is urlEncodedFormEntity) to the request.
                  httpPost.setEntity(urlEncodedFormEntity);
  
                  try {
                      // HttpResponse is an interface just like HttpPost.
                      //Therefore we can't initialize them
                      HttpResponse httpResponse = httpClient.execute(httpPost);
  
                      // According to the JAVA API, InputStream constructor do nothing.
                      //So we can't initialize InputStream although it is not an interface
                      InputStream inputStream = httpResponse.getEntity().getContent();
  
                      InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
  
                      BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
  
                      StringBuilder stringBuilder = new StringBuilder();
  
                      String bufferedStrChunk = null;
  
                      while((bufferedStrChunk = bufferedReader.readLine()) != null){
                          stringBuilder.append(bufferedStrChunk);
                      }
  
                      return stringBuilder.toString();
  
                  } catch (ClientProtocolException cpe) {
                      System.out.println("First Exception caz of HttpResponese :" + cpe);
                      cpe.printStackTrace();
                  } catch (IOException ioe) {
                      System.out.println("Second Exception caz of HttpResponse :" + ioe);
                      ioe.printStackTrace();
                  }
  
              } catch (UnsupportedEncodingException uee) {
                  System.out.println("An Exception given because of UrlEncodedFormEntity argument :" + uee);
                  uee.printStackTrace();
              }
  
              return null;
  </code></pre>