Android Network Development Framework Selection

Source: Internet
Author: User

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




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.