When looking at android basics, we will generally introduce the HttpClient and HttpConnection packages for network operations. The former is an open-source apache library, and the latter is an api that comes with android. Since they are mentioned, both of them are compared. Google has explained in the official documentation that it is recommended to use HttpConnection in Version 2.3 and later. The specific cause is that for versions 2.1 and 2.2, there are several bugs in HttpURLConnection, so we recommend that you use Apache HTTP Client; for later versions, we recommend that you use HttpURLConnection. Apache's HTTP Client is powerful and has a large and flexible API, which is stable and has few bugs. However, this is because it is so huge that it is difficult to improve it to ensure compatibility. Therefore, the android development team should not maintain the library but switch to a more lightweight httpurlconnection. When developing enterprise-level applications, we generally choose to use the encapsulated http framework. Popular open-source applications: 1. volley
2. android-async-http
3. Adjust fit
4. okhttp
5. androidquery 6. AndroidAsync
. They have their own advantages and disadvantages, and different frameworks have different efficiency. When using them, you can test them according to your own conditions and choose which one to use based on the effect, previously, I prefer android-async-http ,. Today, Google has launched its official network communication library volley for the Android platform, which enables faster, simpler, and more robust network communication. Volley provides high-performance network communication functions while at the same time, it also provides good support for network image loading and can fully meet the needs of simple REST clients. We have no reason not to keep up with the trend of the times. In addition, volley is highly scalable. You can customize your network requests as needed. Therefore, we recommend using volley for Development at the end. Of course, the other libraries are also of great learning and reference significance. They can draw their essence into the extended development of the volley framework, make your own ideal http Communication Framework.
Recommended blog: http://instructure.github.io/blog/2013/12/09/volley-vs-retrofit/ http://blog.csdn.net/t12x3456/article/details/9221611
Http://blog.csdn.net/guolin_blog/article/details/12452307