Question

I need a way to keep data updated on my app. I read about SyncAdapter and saw that it requires an AbstractAccountAuthenticator, but my app doesn't require the user to fill any user/password information. How can I deal with this?

Was it helpful?

Solution

If your problem is the sync of the contacts in the native address book and you do not have an authenticator and a user registered with that account-type the contacts that you create will not be shown.

What I did was to create a stub authenticator.

Try this:

example of stub authenticator

Consider that the real problem with SyncAdapter is that it is not active if there is no internet connection. The reason is that the sync adapers are thought to be used to synch your local data with a backend server and so if you do not have internet connection you can't sync and the framework disable the SyncAdapter. What I did was to create my own component for synchronizing the contacts.

OTHER TIPS

A sync adapter doesn't require an AbstractAccountAuthenticator. The SampleSyncAdapter uses one, because it uses authentication, but authentication is not necessary. The sample does it because it syncs contacts with the Contacts Provider.

A sync adapter is associated with an account type. You specify this in the XML file for the sync adapter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top