开发者

Developing Android REST client applications [closed]

开发者 https://www.devze.com 2023-01-08 18:12 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_运维技巧

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

Referring https://www.youtube.com/watch?v=xHXn3Kg2IQE. Can anybody provide source/links which implements such a design?


The Google I/O app follows this design and is easy to follow.

Also a Google engineer briefly describes a REST client development here.


I wrote an Android library based on this specific video session from Google IO 2010. It's ready for production and is already used in several apps

It's called DataDroid and will allow you to add easily to your project :

  • Local data management in a Sqlite database
  • Local data management in memory
  • REST Webservice calls with management of configuration changes (orientation for example) and Activities hiding for a phone call for example

The project contains :

  • The Android Library containing all the classes needed
  • A proof-of-concept project containing examples of code using the Android Library for the different use cases seen above as well as skeleton classes you can copy in your project and modify easily (there are filled with TODOs explaining what you have to do)

Each feature can be implemented independently from the others, so depending on which features you want to use in your project you may need only a part of the skeletons provided in the example project.

Last thing it's available on GitHub under the Beerware license :

As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

You can find more information about its architecture, the way to add it in your project or some examples of apps using it on its official website


See the restful-android example code here:

https://github.com/aug-mn/restful-android

This is a project of the Twin Cities Android Dev Group (aug.mn) led by Jeremy Haberman, Brad Armstrong, and me that aims to provide a reference implementation for the main pattern described in the talk.

There is a restful-android version of his diagram in the docs directory of the source tree that highlights which components are custom, and which are facilities provided by Android SDK classes. You can see Jeremy and Brad doing an overview of it at Minnebar this year:

http://www.youtube.com/watch?v=JkU3VM1Vyp0


You may like Enroscar. Is's based on Google's patterns and looks powerful. Actually, I haven't used it on commercial projects. See their example project.


You can take a look to RESTDroid which implements the Service Pattern (pattern A) shown in this video.


I'm quite successfully using Resteasy mobile, it does automatic proxying using provided interfaces and it's annotations.

0

精彩评论

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