title: HttpClientBuilder missing on Android?
body: <p>Apache has deprecated DefaultHttpClient, but it seems this is not the case for Android, see also here <a href="https://stackoverflow.com/questions/15336477/java-httpclient-how-hard-can-it-be">Deprecated Java HttpClient - How hard can it be?</a></p>
  
  <p>Importing </p>
  
  <pre><code>org.apache.httpcomponents:httpclient:4.3.5
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>new DefaultHttpClient(); 
  </code></pre>
  
  <p>I would now use</p>
  
  <pre><code>HttpClient httpClient = HttpClientBuilder.create().build();
  </code></pre>
  
  <p>to create an http client. This works fine in a Java project, but when used in an Android project, the following import is missing</p>
  
  <pre><code>import org.apache.http.impl.client.HttpClientBuilder;
  </code></pre>
  
  <p>while</p>
  
  <pre><code>HttpClient sendClient =  new DefaultHttpClient();
  </code></pre>
  
  <p>is not marked as deprecated in Android and compiles fine.</p>
  
  <p>I don't want to add the Apache httpclient a second time (and if I would do so, Android Studio would exclude it anyhow).</p>
  
  <p>The Android documentation says here <a href="http://developer.android.com/reference/android/net/http/AndroidHttpClient.html#newInstance(java.lang.String)" rel="nofollow noreferrer">http://developer.android.com/reference/android/net/http/AndroidHttpClient.html#newInstance(java.lang.String)</a> to use</p>
  
  <pre><code>AndroidHttpClient.new Instance(string)
  </code></pre>
  
  <p>to "get an http client with reasonable defaults".</p>
  
  <p>Does anybody know what is the correct way of creating an HttpClient on Android, and what would be the userAgent string!?</p>