I want to use AccountManager in Android, to verify a com.google account. I've already know how to get the account, But I've got several questions,
Edit on 2011.08.20
To clarify the question, what I want to ask it this,
If the account is not in AccountManager, and the account self is under com.google domain, then how can I add it?
If you simply want to have, for example, a button that lets the user add a Google account, consider invoking the ADD_ACCOUNT intent. Another, more advanced, option is to use AccountManager.addAccount.
How AccountManager manage tokens? It retrieves tokens automatically, or I need to do it manually?
The system manages tokens. Well, actually, applications register 'authenticators' which manage tokens for their corresponding service. An authenticator for Google accounts comes preloaded with most Android devices, and third party apps like Twitter add their own authenticators when installed. Apps that want to use Google accounts can request authentication tokens using AccountManager.getAuthToken
.
I'm trying to use Google Reader API with ClientLogin, then I may need password for the first time. If some com.google accounts are stored previously by other apps, can I use them to get the password?
Your app should never ask the user for her Google password. Use the relevant AccountManager
methods to request an auth token for Reader. Unfortunately, since Google Reader doesn't have a public API I can't assist further.