Good articles on various http frameworks

Good articles on various http frameworks

 

 

 

Personally think okhttp is the best network library for android platform.

 

volley is a simple async http library, nothing more. The disadvantage is that it does not support synchronization, which will limit the development mode; it cannot post big data, so it is not suitable for uploading files.

 

android-async-http, like volley, is an asynchronous networking library. But volley is an encapsulated httpUrlConnection, which is an encapsulated httpClient, and HttpClient is not recommended for the android platform, so this library is no longer suitable for the android platform.

 

okhttp is a high-performance http library that supports synchronization and asynchrony, and implements spdy, http2, and websocket protocols. The api is very simple and easy to use. Like volley, it implements the caching of the http protocol. Picasso uses the caching mechanism of okhttp to realize its file caching. The implementation is very elegant and correct. The counter example is UIL (universal image loader), which does its own file caching and does not follow the http caching mechanism.

 

Like picasso, retrofit is a package based on okhttp, and it can be used directly in the project.

 

In addition, the network library AndroidAsync is implemented in the way of nio. okhttp does not provide the way of nio, but nio is more suitable for a large number of connections, and it is a bit like killing a chicken with a knife for mobile platforms. Both picasso and uil do not support inbitmap, and rich image applications that use picasso in the project need to pay attention to this.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942305&siteId=291194637