安卓2.0+帐户重复
我知道您可以在 Android 2.0+ 中设置帐户,这很棒,但正如我最近发现的那样,它可能会造成重复。
我的手机(Sprint HTC Hero 2.1-upadate1)配备了 HTC Sense,这很棒,它还预装了 Peep,它在我设置手机时询问我添加 Twitter 帐户,所以我这么做了。我现在可以打开窥视,一切正常,完美。
但我决定尝试一下 Android 版 Twitter 应用程序。我安装了它,它还要求我创建一个 Twitter 帐户,这不太好。我确实创建了新帐户,并且该应用程序按照预期运行。
然后,当我进入我的帐户时,我可以看到我有两个 Twitter 帐户(同一个)。这是可以在编程中避免的事情还是可以通过操作系统来修复?
我也注意到 Facebook 帐户也有同样的情况。 SDK 中是否有某些内容可以防止这种情况...或者在事后合并帐户?或者这完全取决于开发人员。
如果这取决于开发人员,那么我真的很想看到一些代码/文档,这样我就可以避免此类事情。
I know that you can setup accounts in Android 2.0+ and thats great but as i have recently found out, it can create duplication.
My phone(Sprint HTC hero 2.1-upadate1) comes with HTC Sense and thats great, it also has Peep pre-installed and it asked me when i setup the phone to add a twitter account, and so i did. I can now open peep and it all works, perfect.
But I decided i wanted to try the Twitter for Android app. I installed it and it also asked me to create a twitter account, not good. I did create the new account and the app worked just like it was supposed to.
Then when i go into my accounts i can see that i have two twitter accounts(the same one). Is this something that can be avoided in the programming or is this something that can be fixed with the os?
I also noticed the same for the facebook account. Is there something in the SDK that can prevent this...or combine the accounts after the fact? or is this all completely up to the developers.
If its up to the developers then i would really like to see some code/documentation so i can avoid such things.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Android 上的帐户有帐户“类型”的概念;有关详细信息,请参阅
AccountManager
。例如,Google 帐户的类型为com.google
。 Peep 和 Twitter for Android 应用可能使用不同的帐户类型,并且可能未使用兼容的身份验证令牌(另请参阅AccountManager
和AbstractAccountAuthenticator
)。有关帐户和身份验证器的更多信息,请参阅 SampleSyncAdapter SDK 示例代码。我认为“正确”的做法是开发人员标准化并记录他们正在使用的服务的帐户类型,为这些帐户类型提供帐户身份验证器,然后使用通过 AccountManager 获得的令牌对所述服务进行身份验证/代码>。还有很多机会与联系人、同步等进行更深入的集成。
Accounts on Android have a notion of account 'types'; see
AccountManager
for details. For example, Google Accounts are of the typecom.google
. Peep and the Twitter for Android apps may be using different account types, and may not be using compatible authentication tokens (also seeAccountManager
andAbstractAccountAuthenticator
). More on accounts and authenticators can be found in the SampleSyncAdapter SDK sample code.The 'right' thing to do in my opinion is for developers to standardize on and document account types for services they're consuming, provide account authenticators for those account types, and then authenticate to said services using tokens obtained via
AccountManager
. There are also many opportunities to integrate deeper with contacts, sync, etc.