How can I know google sync is activated on an android device programmatically? -
i need know 2 things :
- does google sync active on device.
- if yes , when last backup datetime.
so far didn't find way hand on data , appreciated. don't mind if it's solution work particular api version.
thanks
you should use accountmanager
, filtering results account type (com.google), above sync state, using contentresolver.
check out code attached:
accountmanager = accountmanager.get(this); account[] accounts = am.getaccountsbytype("com.google"); boolean syncenabled = contentresolver.getsyncautomatically(accounts[0], contactscontract.authority);
Comments
Post a Comment