Alternative HTTP Client Library for Android

I am looking for an alternative HTTP client library than what is already included in the SDK. I could not find anyone. Somebody knows? This should not be open source.

+4
source share
3 answers

Many Android problems built into HttpClient are related to problems that were fixed in HttpClient 4.1. Dirk Boye created a script to convert the HttpClient 4.1 sources to an Android package. You can find some pre-packaged jar files and its script here: https://code.google.com/p/httpclientandroidlib/

+6
source

You have different network management options in Android:

  • OkHttp (Okio required) + Volley + Gson : This is a general REST solution for the JSON-based API. You can use each of these tools separately, for example, if you do not need JSON serialization / deserialization, you can simply use OkHttp + Volley (where OkHttp is an Http client and Volley is a REST library / helper that offers an easy way to upload images). If you just need an alternative Http client, you can use OkHttp (+ Okio), which is the best or one of them right now. OkHttp needs Okio (which you can also use separately) and is a library that complements java.io and java.nio to simplify access, storage and processing of your data. You can find more information about this solution here. .

  • OkHttp (Okio required) + Upgrade + Moshi + Picasso . This option is largely equivalent to the previous one. Retrofitting is comparable to Volley, Moshi to Gson, and Picasso to the image upload department. All this stuff was mostly developed by the same guys, and everything connected together works like a charm. Read more about it here.

  • ION is a very good library that tries to deal with a lot of mentions in options 1 and 2 (Http client, REST helper, uses Gson and uploads images), It is better to check this.

  • Android Async Http : I have not tried and have no information about this, but it looks like it might be worth a look.

I would say that option 1 is replaced by option 2. Option 3 has a lot of fans and is designed mainly by one (awesome) guy , but offers a lot of things that you might not use. That the Square guys (guys behind Option 2) shared everything in 5 different libraries. I can not say much about option 4. Perhaps I will spend it soon.

It is noteworthy that Glide , that is (possibly) the best image upload library developed earlier (acquired by Google) by the Bumptech guys.

The guy working on Okio / OkHttp worked for Google on the SDK http client, worked on Gson, and works on Moshi. This is why I am more inclined towards option 2 at present, people use to do better than before, or at least not worse.

+2
source

OkHttp Square is a good alternative.
Googleโ€™s Volley is also great for design.

+1
source

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


All Articles