开发者

Proper Android REST client [closed]

Closed. This question is seeking recommendations for books, tools, software libraries, and more. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 8 years ago.

Improve this question

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开发者_JS百科'm wondering if there isn't a library that could save me the trouble. We use Jersey on the server side.

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.

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

Any better alternative?


"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.

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.

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 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 (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).


Another great library, sort of similar to RoboSpice, is Mechanoid Ops. It follows the pattern introduced / described by Virgil at IO 2010. Mechanoid also provides additional features that can come in handy such as SQLite database management.

see more here http://robotoworks.com/mechanoid/doc/index.html


It is apparent from this blog post that the Jersey client supports Android from version 2.16.

Author quotes:

From Jersey version 2.16, it should be possible to use Jersey Client on Android.

However, I see there is a bug which is still unresolved (as of Feb 2015).

If your server is using the jersey RESTful implementation, the best choice is to use jersey client. If you're searching for Android REST client, you should try the jersey client version 2.16 (or onwards)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜