Android app with automatic sync

2019-09-16 10:44发布

问题:

recently, I've started the developing of a new app, and this app is in need of constant update. I know I can do it with alarms, but I think that a better way is to add my app to android automatic sync service (the one that is added gmail app and whatsapp for example).

I've looked for that topic, but couldn't find any answer about how to interact with that service. Can anybody provide me an example of how to accomplish it?

Thank you so much,

Vyrphan

回答1:

Check out the SampleSyncAdapter code under the SDK samples. It will be in a directory akin to;

C:/Program Files/Android/android-sdk/samples/android-10/SampleSyncAdapter/



回答2:

Maybe this can help you http://developer.android.com/training/cloudsync/index.html