2011-09-28 111 views
3

如何確定某個特定的Google帳戶是否爲Google Apps帳戶?列出谷歌應用帳戶

我在我的手機上有2個帳戶。

正常的谷歌ACC和谷歌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」 類型兼而有之。

回答

1

AFAIK account.name包含電子郵件,對吧?

Google帳戶(又名gmail)電子郵件地址包含@gmail.com@googlemail.com。 Google Apps帳戶始終擁有自定義域名。這樣你可以區分它們。

+0

好的,只是認爲有一個更好的方法來做到這一點 – jakk

3

我也在想,但是根據@ gmail.com或@ googlemail.com來確定,因爲許多人建議不對此負責。通過某些入口,用戶可以使用Gmail以外的電子郵件實際註冊一個Google帳戶。試試這個註冊入口:https://accounts.google.com/newaccount?hl=en