Overview
Edit:
Any interest is also considering taking a look at RESTful android , this may give you a better overview.
What I learned from experience in trying to implement the Dobjani model is that not everything is written in stone, and it gives you a general idea of what to do, this can change from application to application, but the formula:
Follow these ideas + Add your own = Happy Android App
The model in some applications may differ from the requirement that may not be needed for the account for the SyncAdapter, another may use C2DM, this one that I recently worked on may help someone:
Create an application that has an Account and AccountManager
This will allow you to use the SyncAdapter to synchronize your data. This has been discussed on Create your own SyncAdapter.
Create a ContentProvider (if it suits your needs)
This abstraction allows you to not only access the database, but also access the ServiceHelper to make REST calls, because it has a one-on-one mapping method using REST Arch.
Content Provider | REST Method
request ----------------> GET
Paste ----------------> PUT
update ----------------> POST
delete ----------------> DELETE
ServiceHelper Lamination
This guy will usually start (a) the services that perform the HEST (not necessarily the protocol, but this is the most common) REST method with the parameters that you passed from the ContentProvider. I passed the integer number of matches that was received from UriMatcher in the Content Provider, so I know which REST resource I need to access, i.e.
class ServiceHelper{ public static void execute(Context context,int match,String parameters){
Service
It executes (I use IntentService most of the time) and it goes to RESTMethod with the parameters passed from the helper, why is this useful? well remember that the service is good for running things in the background.
Also implement BroadCastReceiver, so when the service is completed, its work will notify my activity, which again registered this broadcast and request. I believe this last step is not at the Virgil conference, but I'm sure this is a good way.
Class RESTMethod
It takes parameters, the WS resource ( http://myservice.com/service/path ) adds parameters, prepares everything, makes a call and saves the response,
If authtoken is required, you can ask the AccountManager if the service call failed due to authentication, you can cancel authtoken and reauth to get a new token.
Finally, RESTMethod gives me either XML or JSON, regardless of whether I create the processor based on the connector and send the response.
CPU
It charges from parsing the response and inserts it locally.
Sample application? Sure!
Also, if you are interesting in a test application, you are looking at Eli-G , this may not be the best example, but it follows Service REST, it is built with ServiceHelper, Processor, ContentProvider, Loader and Broadcast.