Frame--nohttp and okhttp which is good, volley and nohttp which is good?

Source: Internet
Author: User

Nohttp and Okhttp which is easy to use, volley and nohttp which is useful?


Nohttp Source and demo hosted at GitHub Welcome star: Https://github.com/Y0LANDA/NoHttp

Nohttp is dedicated to making Android network request with download frame, frame live video source.

This blog is the last resort, Nohttp and okhttp which good? Which is volley and okhttp? Which is nohttp and volley? With the rise of nohttp, the number of people who ask this question is more and more, so simply to open a blog.

OkHttp, HttpURLConnection, HttpClient

OkHttp, Httpconnection, httpclient these three guys are for Java, the three APIs are available for both Java and Android ( Android will not be able to use the HttpClient encapsulated framework as Android6.0 removes httpclient. They are all doing the socket layer thing, do Android know that the Android request network needs the child thread initiated, and then use handler to send the results to the main thread. With these three guys you have to request it on a child thread, and you need to encapsulate the parameters, request headers, download, file, and so on.

Nohttp, Volley, Asynchttp, Xutil

Nohttp, Volley, Async-http, Xutil Http module, these guys are Android-specific, is not used in Java, they do not do things in the socket layer, not to ignore the socket, But on top of the three guys based on the derivative framework. Regardless of the parameters, transmission of files, etc. have been done in different degrees of encapsulation. Can be called directly from the main thread, and the UI can be updated directly after the result is obtained.

Difference

So the last thing to say is the difference.
Nohttp, Volley, Async-http, Xutil is a plane, OkHttp, HttpClient, HttpClient is a plane, the contrast should be said Nohttp and volley which is easy to use, Okhttp and httpclient which are easy to use.

Which one is good?
    • If you want to ask Nohttp and volley which is good, I recommend nohttp, the reason is nohttp encapsulation: File download, breakpoint continuation, 304 cache, 302/303 parameters, transfer files, request headers, multi-file upload, large file upload, automatic cookie management and other functions, These are volley and not, and use volley need us to write a lot of code to do encapsulation, and nohttp directly can use, do not need to do two times development, of course nohttp architecture design is very convenient to develop their own package.

    • Between Okhttp and HttpURLConnection (HttpClient is completely deprecated in Android6.0), if the developer encapsulates his own framework, I recommend okhttp, a framework that Google officially recommends. Reasons not to repeat, Google Baidu a big push.

Nohttp Source and demo hosted at GitHub Welcome star: Https://github.com/Y0LANDA/NoHttp

Frame--nohttp and okhttp which is good, volley and nohttp which is good?

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.