list google apps accounts
How can I determine if a specific google account is a 开发者_开发知识库Google Apps account?
I have 2 accounts on my phone.
a normal Google acc and a Google Apps account
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);
}
It prints "com.google" as type for both.
I was wondering too, but determine based on @gmail.com or @googlemail.com as many suggested isn't accountable. Through some entrances, users can actually register a Google Account using emails other than Gmail. Try this sign-up entrance: https://accounts.google.com/newaccount?hl=en
AFAIK account.name
contains email, right?
Google account (aka gmail) email address contains @gmail.com
or @googlemail.com
. Google Apps account always have custom domains. This way you can distinguish them.
精彩评论