I'm building an Android app that will communicate with a REST
service using HTTP
and HTTPS
for downloading JSON
and file data. I'm looking for a HTTP networking library to use and am evaluating options. I've found one called AsyncHttpClient
(loopj.com/android-async-http) which looks good and I see Instagram uses it, but I see it's built on the Apache HttpClient
libraries and I seem to recall reading somewhere that the Apache library is being left behind in favour of HttpURLConnection
. Is this something I should be concerned about? Is there another library I should consider instead? I planned to target a minimum Android SDK of 2.1 if this makes a difference.

- 3,414
- 5
- 40
- 45

- 3,357
- 7
- 46
- 82
4 Answers
You are right about HttpUrlConnection
recommendations, however, you can check it's initial source and check the rootcause of this recommendation, does it really applies to you?
http://android-developers.blogspot.com/2011/09/androids-http-clients.html
The major constrain of the HttpUrlConnection
for me - is that it doesn't support Multipart initially. Of course it's not so hard to add, but it looks weird.
Also, Apache implementation is quite good basically, just one advice - don't forget to use AndroidHttpClient
instead of Default
one.
And about JSON - I will recommend separate library for that, most probably - Google's GSON http://code.google.com/p/google-gson/ .
For me AndroidHttpClient
+ Gson worked pretty fine.
Good luck

- 2,544
- 16
- 13
Take a look at http://loopj.com/android-async-http/
Overview says: An asynchronous callback-based Http client for Android built on top of Apache’s HttpClient libraries. All requests are made outside of your app’s main UI thread, but any callback logic will be executed on the same thread as the callback was created using Android’s Handler message passing.
This library was used by popular apps such as Instagram, Pinterest, Heyzap and etc.

- 1,268
- 11
- 10
I just released a library called DroidNetworking which supports HTTP caching, authentication, HTTP and HTTPS and many other features.
https://github.com/sogeti/DroidNetworking
BR Martin

- 1,633
- 3
- 12
- 5
-
I have taken a bird eye view and it seems simpler (developers interface) and more powerful (extra features) than the loopj's library. Thank you. – caligari Jul 11 '13 at 10:33
Google has an official http java client library here: https://code.google.com/p/google-http-java-client/wiki/Android

- 7,481
- 4
- 58
- 67