I have an application in which the user can edit/add records offline and they should be sent to the server as soon as the Internet connection is established. It seems to be the exact behavior of the GMail application:
You can write an email offline, click “Send”, close the application/process, and when the Internet connection is back, a sync is performed which sends the email to the server.
The problem is that I already have a SyncAccount with a SyncAdapter running a daily sync. If I were to add a second sync using ContentResolver.addPeriodicSync, I would have to create another authority and thus would have to use different database tables?
Can I schedule two sync operations independent from each other, accessing the same database?
Problem solved. Apparently, you can request a one-time sync immediately, rather than scheduling one. You can also supply a list of extras to this one-time sync.
My solution is thus to put a parameter in that bundle and just do my magic accordingly in the adapter’s onPerformSync method.