Google Volley与Android-Async-Http [英] Google Volley vs Android-Async-Http

查看:191
本文介绍了Google Volley与Android-Async-Http的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究这两个Android Http Networking库。

I am looking into both these Android Http Networking libraries.

我希望有人使用这两个库的经验。我个人一直很愉快地使用 http://loopj.com/android-async-http/ 库。但是最近有人建议我使用Volley Framework。

I would like some peoples experiences with using the two libraries. Personally I have always used the http://loopj.com/android-async-http/ library quite happily. But it was recently suggested to me to use the Volley Framework.

我会从一个上得到什么好处?

到目前为止,Volley在一个库中集成了许多不错的功能,例如图像加载,请求缓存,请求取消。

What benefits will I get from one over the other?
From my reading so far, Volley incorporates a number of nice features such as Image Loading, Request Caching, Request Cancelling all in one library.

我当前的用例/规格:

从我的android应用程序中使用Web服务。

Consume web services from my android applications.


  • 从Web服务接收JSON对象

  • 易于与GUI集成

  • 原始性能的稳定性和可靠性

  • 对库的长期维护和支持。

  • 易于使用/易于实现

  • Receive JSON Objects from web service
  • Easy To integrate with the GUI
  • Stability and Reliability over raw performance
  • Long term maintenance and support of the library.
  • Ease of use / ease of implementation

从SE的一些读物开始:

From some reading up on SE:

齐射很好,但是,在不利的一面,它是一个没有证件的,不被支持的,把代码扔在墙上,并在上面进行I | O演示库。

"Volley is all good but, On the minus side, it is one undocumented, unsupported, "throw the code over the wall and do an I|O presentation on it" library."

因此,我认为清晰的Volley可能会成功的功能,但是记录和维护得如何?如果我决定使用它,那么4年后还会支持它吗?

So I think its clear Volley might get the tick for features, But how well documented and maintained is it? If I decide to use it will there still be support for it 4 years down the line?

推荐答案

Volley和Android Async Http是

Volley and Android Async Http are different things.


  • Android异步Http :是功能强大的Http客户端。提供一些功能,如REST帮助程序以及与其他库进行JSON解析的集成。

  • Android Async Http: Is a powerful Http client. Offers some functionalities as REST helper and integration for JSON parsing with other libraries.

Volley :是一种REST帮助程序/库,可提供帮助您处理异步请求和图像加载。 Volley,它不是http客户端。如果您不提供Volley,则使用SDK http客户端(apache或httpclient,取决于API级别),但是volley的常见客户端是OkHttp( https://goo.gl/nl2DfN )。您也可以轻松地将Volley与Gson集成。

Volley: Is a REST helper/library that helps you to deal with async requests and image loading. Volley it's not an http client. Volley uses the SDK http clients (the apache or the httpclient depending on the API level) if you don't provide one, but a common client for volley is OkHttp (https://goo.gl/nl2DfN). You can integrate Volley with Gson easily as well.

根据我的观点,您对单个库,更少的自定义,更多的不必要代码。这就是如今像Android Async Http或ION这样的库失去控制的原因,而Square解决方案(Okio + OkHttp + Retrofit + Moshi + Picasso-这是五个库)之类的其他选择越来越受青睐。因此,这里有5个库,它们可以单独使用,也可以分别作为2、3或4一起使用。这就是灵活性和强大功能。

From my point of view, as much responsibility you give to a single library, less customization you have and more unneeded code you'll add. That's the reason libraries as Android Async Http or ION are losing grip nowadays and other options like the Square solutions (Okio + OkHttp + Retrofit + Moshi + Picasso - Those are five libraries) are gaining grip. So here you have 5 libraries that can be used separately as standalone or tied together as 2, 3 or 4. That's flexibility and power.

有关此看看这个答案。

这篇关于Google Volley与Android-Async-Http的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆