Search code examples
androidandroid-contentproviderfrequencyandroid-syncadapter

How to define frequency of SyncAdapter updates on android?


ContentProvided defined for synchronization is dummy (in accordance with this approach).


Solution

  • If API > 8, (95% of devices) use ContentResolver.addPeriodicSync()

    If API = 7, (5.5% of devices as of Mar 2102) create a service with a periodic timer callback, and call ContentResolver.requestSync().

    API < 6 does not support syncAdapter, so no worries.