How to Get all Registered Email Accounts in Android

In this example, we’ll show how to get all registered Google and other email accounts in Android.

AccountManager class provides access to all registered user accounts in device. AccountManager generates the auth tokens for different applications and caches it. It is also responsible for periodic check for the validity of auth tokens.

For accessing the registered accounts in your Android phone, you must add android.permission.GET_ACCOUNTS permission to your Manifest file. This permission allows access to the list of accounts in the Accounts Service.

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

Below example we’ll show the list of registered email address in a ListView. Well, lets begin with the layout

A blogger, a bit of tech freak and a software developer. He is a thought leader in the fusion of design and mobile technologies. He is the author of Xamarin Mobile Application Development for Android Book (goo.gl/qUZ0XV3), DZone MVB and founder of stacktips.com.