in the article "java&android open Source Library code anatomy" のandroid-smart-image-view, we mention Android-async-http This open source Library, this article formally begins to detail this library's realization, simultaneously unifies the source code to discuss how to design an elegant Android network request frame. for some time, Android developers should be familiar with this library, because it's encapsulation of Apache's HttpClient API allows developers to make network requests and responses simple and elegant, while simultaneously supporting both synchronous and asynchronous requests. The Network request framework generally needs to have at least the following components: 1) Network request class, used to encapsulate the request Url,http protocol parameters and other information,3) network response class, for processing the error code returned by the server, and to parse the returned data content according to the data format; 3) The network requests the client class, provides the interface to the framework user, facilitates the user to initiate the network request, and handles the network response; 4) The above three steps depend on some of the tool classes. According to the above, we will introduce this open source library in four articles: 1) Network request asynchttprequest;2) network response responsehandlerinterface;3) Network request client synchttpclient and asynchttpclient;4) Others;
Java&android Open Source Library code anatomy のandroid-async-http (How to design an elegant Android network request framework that supports both synchronous and asynchronous requests) begins