As we are leaning towards Level 10 as our targetSDK for Aerogear
we should consider current usage of HttpClient.
As Summers pointed out in #aerogear IRC, Google has deprecated the
platform HttpClient library, and stopped patching it.
Apache HTTP Client had been a lesser evil before, but has been
deprecated with Gingerbread (Level 9 API), and
java.net.HttpURLConnection has been bugfixed in later versions and
made the preferred choice .
The JavaDoc in one of google-http-java-client library classes sums it
up nicely .
We are currently using HttpClient in aerogear-android.
To be future proof we should therefore move to
java.net.HttpURLConnection. That API is one of those awkward early
java APIs that isn't very nice to use. The big sore spot from
backwards compatibility point of view is that HttpURLConnection had
some ugly bugs in previous versions.
Google for their part is developing google-http-java-client library
mentioned above - it's a wrapper library that checks current runtime
environment, and uses HttpClient underneath when API Level is less
than 9, otherwise it uses HttpURLConnection.
I haven't played enough with google-http-java-client to say we should
use it. It comes with quite some dependencies, but those seem like
optional, and it's possible that with the extent of functionality that
we require the whole lib after proguard treatment can be squeezed to a
really small size. But as I said, I need to play with it some more.
Any thoughts welcome.
aerogear-dev mailing list