How can I know google sync is activated on an android device programmatically? -


i need know 2 things :

  1. does google sync active on device.
  2. 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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -