What version of org.apache.http.client is in Android 2.2? How to use lib in an application?

How to find out which version of HTTPclient is in Android 2.2? I think this is important information, but I did not see anything in the Google API documentation http://developer.android.com/reference/org/apache/http/client/package-summary.html

Also, after downloading Apache HTTPclient 4.1.3 (or beta 4.2), how can I make sure my application uses API calls from the downloaded Apache library instead of the Android built-in HTTPclient API?

I think the last time I tried this, I got a lot of warnings when my application started working on a duplicate API

Thanks!

+4
source share
2 answers

According to the official android link, the android team supports HttpURLConnection more than DefaultHttpClient from apache ... http://android-developers.blogspot.in/2011/09/androids-http-clients.html

0
source

Iam also uses the Android 2.2 SDK. I downloaded the latest Apache HTTP client (httpclient-4.2.1, httpcore-4.2.1, httpmime-4.2.1, apache-mime4j-core-0.7.2) and added the libs files to the build path. Then I was able to check the version that is used:

code:

VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.http.client",getClass().getClassLoader()); String version = vi.getRelease(); Log.d("apache http client version", version); 

Output:

 apache http client version 4.2.1 
0
source

Source: https://habr.com/ru/post/972982/


All Articles