I'm trying to figure out whether I need to use a sync adapter in my android app.
Procedural Approach Example:
Question is, should I use a sync adapter for this work? If so what would be the high level approach based on my example above. Thank you.
What server application do you want to sync with? If your app wants to synchronize user data with a server, C2DM (using the sync adapter) can be the way to go. It does provide overhead. I find that in most cases, a simple restful interface is easier to create and maintain.
If you want a more detailed answer, you'll have to provide more information on your app.
If you don't care battery draining, use SyncAdapter
to do periodic bidirectional syncing(down and upstream) and modify only local db to interact with user's action. This way you only need two scripts on server side, one for downstream syncing and the other for upstream syncing.
Of course you need have
1). 3 flags, i.e. insert_state, update_state and delete_state for local db to indicate dirty data.
2). uuid for both local and remote db
GoogleIO RESTFUL SYNCING Reference: http://www.youtube.com/watch?v=xHXn3Kg2IQE
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With