I am new to syncAdapter. I watched a video on google IO (lecture presentation here ) and I read 2 tutorials ( here and here ).
I also tried the tutorial code, and it disappoints me that I cannot figure out how to correctly implement syncAdapter.
I believe that some of the preferences (either in the manifest or in the xml files) are simply wrong, but I cannot understand why.
I managed to add a synchronization account and also show it with its icon.
however, I encounter some strange problems that I cannot understand why they occur:
allow you to synchronize your account. The end user cannot click the sync button. it also doesn't seem to auto-sync, although I tried to add such a thing when adding an account.
after adding the account, the end user may see a strange account description: "res / xml / authenticator.xml". not sure where to install it.
when you click on the account (after adding it), I see an empty list (which, it seems to me, will add more elements in the future, I also need to synchronize with facebook and gmail, but I can not succeed with adding my own ContentProvider to this list.
I don't have to do real authorization, so I just use the following code instead in activities that extend from AccountAuthenticatorActivity:
accountManager.addAccountExplicitly(account, PASSWORD, null); final Intent intent = new Intent(); intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, USERNAME); intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, accountType); setAccountAuthenticatorResult(intent.getExtras()); setResult(RESULT_OK, intent); finish();
I also tried to set up automatic synchronization and enable synchronization using the one described here .
android synchronization android-contentprovider android-syncadapter
android developer
source share