[英]How can I use AccountManager in Android with Google Account?
I want to use AccountManager in Android, to verify a com.google account. 我想在Android中使用AccountManager来验证com.google帐户。 I've already know how to get the account, But I've got several questions,
我已经知道如何获得该帐户,但是我有几个问题,
Edit on 2011.08.20 编辑于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?
如果该帐户不在AccountManager中,并且该帐户本身在com.google域下,那么如何添加它?
If you simply want to have, for example, a button that lets the user add a Google account, consider invoking the ADD_ACCOUNT intent. 例如,如果您仅想使用一个按钮来允许用户添加Google帐户,请考虑调用ADD_ACCOUNT意图。 Another, more advanced, option is to use AccountManager.addAccount .
另一个更高级的选择是使用AccountManager.addAccount 。
How AccountManager manage tokens?
AccountManager如何管理令牌? 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.
大多数Android设备都预装有Google帐户的身份验证器,而Twitter等第三方应用程序在安装时会添加自己的身份验证器。 Apps that want to use Google accounts can request authentication tokens using
AccountManager.getAuthToken
. 想要使用Google帐户的应用可以使用
AccountManager.getAuthToken
请求身份验证令牌。
I'm trying to use Google Reader API with ClientLogin, then I may need password for the first time.
我试图将Google Reader API与ClientLogin一起使用,那么我可能第一次需要密码。 If some com.google accounts are stored previously by other apps, can I use them to get the password?
如果某些com.google帐户以前是由其他应用存储的,我可以使用它们来获取密码吗?
Your app should never ask the user for her Google password . 您的应用程序绝不应向用户询问她的Google密码 。 Use the relevant
AccountManager
methods to request an auth token for Reader. 使用相关的
AccountManager
方法为Reader请求身份验证令牌。 Unfortunately, since Google Reader doesn't have a public API I can't assist further. 不幸的是,由于Google阅读器没有公共API,因此我们无法提供进一步的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.