Apache HTTPClient 4.x vs HttpUrlConnection - which one is faster on Android?

I need to optimize the data loading speed in my application.

I recalled that, according to a Google Developers blog post, HttpUrlConnection recommends being faster and easier.

For Gingerbread and better, HttpURLConnection is the best choice. This simple API and small size make it very suitable for Android. transparent compression and responsive caching reduce network usage, improve speed and save battery. Newer applications should use HttpURLConnection; this is where we will spend our energy in the future.

But the fact is that many people recommend ApacheHTTPClient, but Google says that HttpUrlConnection is better.

Which http client would you recommend improving your overall speed? Assume this question that the complexity of the code I have to write does not matter.

+4
source share
1 answer

I think this is pretty clear from the blogpost of Android developers. When it comes to Android, you can't get more authority than Google itself. So yes, that’s true;)

"For Gingerbread and better, HttpURLConnection is the best choice. Its simple API and small size are great for Android. Transparent compression and responsive caching reduce network usage, improve speed and save battery."

What part of this you doubt.

+2
source

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


All Articles