Is there much difference between those two and which one is preferably to use?
AndroidHttpClient: Subclass of the Apache
DefaultHttpClient that is configured with reasonable default settings and registered schemes for Android, and also lets the user add
This client processes cookies but does not retain them by default. To retain cookies, simply add a cookie store to the
Based on the Android source code:
AndroidHttpClient is set to do the following extra settings:
- Turn off stale checking, since the connections can break all the time.
- Set ConnectionTimeout and SoTimeout (20 or 60 seconds)
- Turn off redirecting.
- Use a session cache for SSL sockets.
- Use gzip compressed traffic between client and server if it’s possible.
- Doesn’t retain cookies by default.
This interesting blog post from an android developer gives an overview of the different Android’s HTTP clients.
According to this post, URLConnection should be preferred over DefaultHttpClient or AndroidHttpClient on Gingerbread and above.