I’m confused about which way is the best to have multiple tables get synced in my application.
I have one content provider and intend to have multiple tables (events, users, etc). I also have a rest-server that the app is supposed to communicate with. I’m wondering about what is the best practice to handle multiple connections (put, get, post and delete) for each of the tables. They have also relationships, like one user can be attending an event, but also be the owner of the event. So if I have created a user and a belonging event to that user, I can either upload the user, get back info from the server about the user, upload the event with the information about the user, get back that information and then update the user with the new event information.
What is the best way to solve these problems? Should I create a method (http://example.com/sync) that aggregates all the data that should be synced? Or should I just stick with, sometimes ~15-20 requests?
I would recommend you to watch Google I/O 2010 – Android REST client applications video.
It’s a fantastic introduction into some of the concepts and recommended patterns for writing well design syncing applications.
I personally found answers to most of my questions.
Also look this presentation. Along with this presentation and the sync adapter sample provided with the SDK, the following list should provide you ample ammunition to get a sync adapter up and running fairly quickly.