There is a well-known ASIHttpRequest library in iOS development that is used to process network request operations. Today we will introduce an Android-async-http network request library that is equally powerful on android, currently, Instagram and Pinterest Android are very popular apps that use this network request library. This network request library is an Asynchronous Network request processing Library Based on the Apache HttpClient library. network processing is based on non-UI threads of Android and request results are processed through callback. Its main features are as follows: It processes asynchronous Http requests and processes callback results through anonymous internal classes. All Http requests are in non-UI threads, UI operations are not blocked. When the thread pool is used to process concurrent requests to process file uploads, download response results are automatically packaged, JSON format is used to automatically handle connection disconnections, And the request re-connection using android-async-http is also very simple, go to the official website. Use the following code to create an asynchronous request: [java] AsyncHttpClient client = new AsyncHttpClient (); client. get ("http://www.baidu.com", new AsyncHttpResponseHandler () {@ Override public void onSuccess (String response) {System. out. println (response); textView. setText (response) ;}@ Override public void onStart () {super. onStart (); System. out. println ("onStart") ;}@ Override public void onFinish () {super. onFinish (); System. out. pr Intln ("onFinish") ;}} use the URL specified by the Get request and the callback function to process the request results. At the same time, the request methods also support POST and PUT, the request also supports parameter transmission. The following describes how to use a JSON string as a parameter to access the server: [java] try {JSONObject jsonObject = new JSONObject (); jsonObject. put ("username", "ryantang"); StringEntity stringEntity = new StringEntity (jsonObject. toString (); client. post (MainActivity. this, "http://api.com/login", stringEntity, "application/json", new JsonHttpResponseHandler () {@ Override Public void onSuccess (JSONObject jsonObject) {super. onSuccess (jsonObject) ;}}) ;}catch (JSONException e) {e. printStackTrace ();} catch (UnsupportedEncodingException e) {e. printStackTrace ();} officially recommended method of use, using a static request object, let's take a look at the official example of an API to access Twitter: Usage: Due to network requests, do not forget to add permissions: [html] <uses-permission android: name = "android. permission. INTERNET "/> other functions, such as uploading and downloading files, can be viewed on the official website. I will not repeat them here!