ASIHTTPRequest equivalent for Android or any HTTP

2019-03-15 10:56发布

问题:

I'm developing an app that will make extensive HTTP requests.

I know for a fact that iOS has a third-party library called ASIHTTPRequest to manage and organize all these requests, making it much easier and less tedious.

Is there a similar library available for Android?

回答1:

According to this talk, if you're targeting pre-Gingerbread versions (<2.3) you should stick to Apache Http Client library. If however you're targeting Gingerbread or later, you will be safer to use the java.net.URLConneciton class as recommended by the Google engineer.



回答2:

Use https://github.com/loopj/android-async-http
Just like ASIHTTPRequest, this lib makes is easy to make async requests without worrying about threads or async tasks.
It even includes a JSON parser.

You can also use http://code.google.com/p/android-query/wiki/AsyncAPI which looks good

Update : Android has released which does exactly what you want : http://www.javacodegeeks.com/2013/06/android-volley-library-example.html