I used James Smith's samrtImageView component before and found it useful. On his github, I found an Android Asynchronous Http Client, which is also good. I will introduce it to you here. The android built-in apache httpClient is executed asynchronously. The http request is outside the UI thread and encapsulates get/post. It supports multi-file upload and has a small size, optimized for mobile network connection, smart automatic request enrichment, automatic gzip, binary file download, built-in response parsed into json, and persistent cookie storage. Many projects and development programs are in use, such as the famous photo sharing software Instagram.
Install and use: download the latest jar package on the author page and put it in the libs directory of the program.
Create a new AsyncHttpClient instance and submit a request:
AsyncHttpClient client = new AsyncHttpClient ();
Client. get ("http://www.google.com", new AsyncHttpResponseHandler (){
@ Override
Public void onSuccess (String response ){
System. out. println (response );
}
});
No, it's that simple.