-
Notifications
You must be signed in to change notification settings - Fork 50
Project Introduction
This project represents an effort to provide an implementation of Apache HttpClient, which can be deployed on Google Android in parallel to the outdated version shipped with the platform while, due to alternative package name of this library, it's not using any of Android provided outdated classes, and project does support Android API 23+ where org.apache.http
classes have been removed completely.
https://hc.apache.org/httpcomponents-client-4.5.x/android.html
Google Android 1.0 was released with a pre-BETA snapshot of Apache HttpClient. To coincide with the first Android release Apache HttpClient 4.0 APIs had to be frozen prematurely, while many of interfaces and internal structures were still not fully worked out. As Apache HttpClient 4.0 was maturing the project was expecting Google to incorporate the latest code improvements into their code tree. Unfortunately it did not happen. Version of Apache HttpClient shipped with Android has effectively become a fork. Eventually Google decided to discontinue further development of their fork while refusing to upgrade to the stock version of Apache HttpClient citing compatibility concerns as a reason for such decision. As a result those Android developers who would like to continue using Apache HttpClient APIs on Android cannot take advantage of newer features, performance improvements and bug fixes.
Apache HttpClient 4.X port for Android is intended to remedy the situation by providing releases compatible with Google Android.
- Compiled against HttpClient 4.X APIs.
- Commons Logging replaced with Android Logging.
- Base64 implementation from Commons Codec replaced with Android Base64.
- HttpClient port for Android is compiled against the official Android SDK v23 and is expected to be fully compatible with any code consuming HttpClient services through its interface (HttpClient) rather than the default implementation (DefaultHttpClient).
- In your code you'll have to use classes from package
cz.msebera.android.httpclient
instead oforg.apache.http
- This library provides compatibility with Android SDK 23 and higher
- You do not have to use
useLibrary 'org.apache.http.legacy'
statement, which was introduced for projects that didn't migrate from Android provided HttpClient classes
HttpClient 4.X for Android is available from the Maven central and can be added to Gradle builds as the following dependency:
repositories {
mavenCentral()
}
dependencies {
// Latest version of 4.3 API is 4.3.6.1
// Latest version of 4.4 API is 4.4.1.2
// Latest version of 4.5 API is 4.5.8
// other versions and documentation can be found here: https://github.com/smarek/httpclient-android/releases
compile group: 'cz.msebera.android' , name: 'httpclient' , version: '4.5.8'
}
© 2015-2019 Marek Sebera marek.sebera@gmail.com