为 Android C2DM 选择 Google 帐户
我的 C2DM 服务有问题。鉴于设备上登录了多个 Google 帐户,我希望我的应用程序选择其中一个帐户来注册 C2DM(您知道使用首选项)。是否可以?
提前致谢
I have a problem with C2DM service. Given that there is more than one Google account loged on the device I would like my application to choose one of these accounts to register to C2DM with (You know using preferences). Is it possible?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的。查看 Chrome to Phone 应用程序 (http://code.google.com/p/chrometophone/)。他们从生成的字符串数组中构建了一个帐户列表,如下所示:
Yes, it is possible. Look at the Chrome to Phone application (http://code.google.com/p/chrometophone/). There they build a list of accounts from the String array generated like this:
经过一番思考后,我认为这样行不通。所有 C2DM 需要的是“现有连接”,我认为无论有多少个 google 帐户,都只有一个连接。
After giving it some thought I think it just does't work this way. All the C2DM needs is 'existing connection' and I think there is only one connection no matter how many google accounts there are.