Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; import android.accounts.Account; import android.accounts.AccountManager; import android.content.Context; public class Main { public static final String GOOGLE_ACCOUNT_TYPE = "com.google"; public static List<Account> getAccounts(final Context context) { AccountManager accountManager = AccountManager.get(context); return Arrays.asList(accountManager.getAccountsByType(GOOGLE_ACCOUNT_TYPE)); } }