正确的Andr​​oid REST客户端客户端、正确、oid、Andr

2023-09-03 21:30:16 作者:何处繁华笙歌落

我做我自己的REST客户端库的一个Android应用程序,但看的谷歌I / O presentation关于这个问题我意识到我是有错(precisely他们展示幻灯片9)。

I made my own REST client library for an Android application, but after watching the Google I/O presentation on the subject I realized I had it all wrong (precisely what they show slide 9).

现在我期待再次这样做了正确的方式,但我不知道如果没有一个库,它可以救我的麻烦。我们用球衣在服务器端。

Now I am looking to do it again the right way, but I'm wondering if there isn't a library that could save me the trouble. We use Jersey on the server side.

我看不同的解决方案:波峰和的 Resty ,但我想找到一个Android解决方案,所以我不必须实现ContentProvider的东西,我自己和 Android的jbridge ,但它看起来并不十分活跃。

I've looked at different solutions : CRest and Resty, but what I'd like to find an Android solution so I don't have to implement the ContentProvider stuff myself, and android-jbridge, but it doesn't look very active.

在这一点上,我考虑使用的 RestTemplate (从春季安卓),写东西围绕它自己,但会需要一些时间。

At this point I'm considering using RestTemplate (from Spring Android) and writing the stuff around it myself, but that'll take some time.

任何更好的选择吗?

推荐答案

开发Android REST客户端应用程序维吉尔Dobjanschi引发了很多讨论,因为没有源$ C ​​$ C是在会议期间presented或提供了算账。

"Developing Android REST client applications" by Virgil Dobjanschi led to much discussion, since no source code was presented during the session or was provided afterwards.

唯一的参考实现,我知道(请评论,如果你知道更多)可在 Datadroid (在谷歌IO会在/提presentation)。这是一个库,你可以在自己的应用程序中使用。

The only reference implementation I know (please comment if you know more) is available at Datadroid (the Google IO session is mentioned under /presentation). It is a library which you can use in your own application.

更新 还有其他可用的库。我不知道他们是如何确认到Dobjanschis模式,但我想一一列举,供大家参考(文字取自图书馆的主页):

Update There are other libraries available. I do not know how they confirm to Dobjanschis patterns, but I would like to list them for your reference (text is taken from the homepage of the library):

RoboSpice 是使编写异步容易长时间运行任务的模块化机器人库。它是一家专业从事网络请求,支持缓存和提供REST请求出即用的使用扩展模块中。

RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.

RESTDroid (目前阿尔法)提供了一个方法来处理调用REST网络服务。它仅包含基本逻辑来处理这些请求,扩展是可能的模块(一些被提供)。

RESTDroid (currently alpha) provides a way to handle calls to REST web-services. It contains only the fundamental logic to handle these requests, extension is possible with modules (some are provided).

 
精彩推荐