继续使用 LoopJ AndroidAsyncHttp 库(弃用)

Continue using LoopJ AndroidAsyncHttp library (deprecation)

我需要与我们的 REST-API 通信。我找到了 LoopJ AndroidAsyncHttp library, but I am not sure if it is a good idea to use it, because it seems to use the HttpClient which is now deprecated in Android API 22. I found this apache project,但我不确定我是否可以简单地将它添加到我的项目中,它是否可以与 AndroidAsyncHttp 一起使用。有什么想法或替代方案吗?

Android volley 库是 http 请求的优秀解决方案:

https://github.com/mcxiaoke/android-volley

它提供了三种常见的请求类型:StringRequest、JsonObjectRequest和ImageRequest,但您也可以编写自定义请求。 它很容易学习,网络上有大量示例。