There's a REST service that I use to populate info in my database, that is later used by my app. I've read several threads on the matter, and now have to decide how I want the sync between the REST service and my DB to work.
Think of an app that gets info from google finance APIs about stocks and stores it in a DB, displays the information when the app is launched, and sends notifications when specific events happen in the stock price.
I already implemented the simple option of AsyncTask that is launched when a user manually requests a sync. Now I have to implement the auto-sync and these are the options I found:
- Create a
Service
that will do the syncing - Use a Sync Adapter / Sync Provider
So I found a lot of advantages to the second option, particularly those explained in this video, but also two major disadvantages:
- I couldn't find good documentation for android sync (a few third party articles such as these, but no official Google or Android Developers guide)
- According to this article messing up in a Sync Adapter can cause major issues such as OS crash and reboot.
Most of the info I found is pretty old, so maybe things have changed since, but my App is supposed to work with API level 8 and above, so I would be very thankful for any recommendations and links to valuable documentation.