简体   繁体   English

如何将多个Google帐户添加到Android应用中,以便用户可以在多个帐户之间切换

[英]How to add multiple google accounts to an android app so that user can switch between accounts

Please suggest me how can I add multiple google accounts to my app so that user can switch between accounts and app UI data will change according to the chosen account(just like in android Gmail app). 请建议我如何将多个Google帐户添加到我的应用程序中,以便用户可以在帐户之间进行切换,并且应用程序UI数据将根据所选帐户而变化(就像在android Gmail应用程序中一样)。

How auth token will be handled for each account? 每个帐户如何处理身份验证令牌?

I have implemented log in using the single account. 我已经使用单个帐户实现了登录。

User can add multiple google accounts to the android environment, then he/she can switch between them in your app. 用户可以将多个Google帐户添加到android环境中,然后他/她可以在您的应用中在它们之间进行切换。

EDIT: I think you shouldn't think about multiple accounts, you just implement 编辑:我认为您不应该考虑多个帐户,您只需实施

  • login 登录
  • logout 登出

logic and when user changes account's you don't need to handle how many account the user has. 逻辑,并且当用户更改帐户时,您无需处理用户拥有多少个帐户。

当您的Android设备已添加到您的Android设备中,并且您从Google帐户访问令牌时,它将要求选择要访问的帐户。

Go to settings-> Accounts->Add Account->Google 转到设置->帐户->添加帐户-> Google

Then follow the instructions and add other extra google accounts to switch in any apps in android 然后按照说明进行操作,并添加其他额外的Google帐户以在android中切换任何应用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android应用上使用Google+帐户提供多用户访问权限 - How can I provide multiple-user access using Google+ accounts on the Android app 在Android应用中处理多个帐户 - Handling multiple accounts in Android app 在单个Android应用中使用多个firebase帐户进行Google Analytics - Use multiple firebase accounts in single android app for google analytics Google In App Billing 区分用户帐户 - Google In App Billing differentiate user accounts 应用服务器如何将Google帐户与用户的设备相关联? - How can an application server associate Google accounts to a user's device? 带有appengine Google用户帐户的Android同步适配器 - Android sync adapter with appengine Google user accounts Android Java添加编辑联系人谷歌帐户 - android java add edit contacts google accounts Google Photo App如何在未经许可的情况下读取帐户? - How can the Google Photo App read the accounts without permission? 具有多个帐户的Android应用的GCM注册ID的唯一性是什么? - How unique is a GCM registration ID for an Android app with multiple accounts? Android应用程序检查设备上的用户Dropbox帐户 - Android app check for user Dropbox accounts on device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM