列出谷歌应用程序帐户

时间:2011-09-28 18:38:35

标签: android accountmanager

如何确定特定的Google帐户是否为Google Apps帐户?

我的手机上有2个帐户。

普通的Google acc和Google Apps帐户

accountManager = AccountManager.get(getApplicationContext());
Account[] accounts = accountManager.getAccounts();
for ( int i = 0; i < accounts.length; i++ )
{
    Log.d(TAG, accounts[i].name + " - " + accounts[i].type);            
}

它打印“com.google”作为两者的类型。

2 个答案:

答案 0 :(得分:3)

我也想知道,但根据@ gmail.com或@ googlemail.com确定,因为许多建议不负责任。通过一些入口,用户实际上可以使用Gmail以外的电子邮件注册Google帐户。试试这个注册入口:https://accounts.google.com/newaccount?hl=en

答案 1 :(得分:1)

AFAIK account.name包含电子邮件,对吗?

Google帐户(又名gmail)电子邮件地址包含@gmail.com@googlemail.com。 Google Apps帐户始终拥有自定义域。通过这种方式,您可以区分它们。