Loading...

How to Get Registered Email Address Programmatically in Android

In this tutorial, you will learn to get and display registered email address programmatically in android application. To get registered email address in android we have use AccountManager class, this allows us to access to get registered user email address/account from android device.

To access and get user account email address in android phone, we have to add <uses-permission android:name="android.permission.GET_ACCOUNTS" /> permission in AndroidManifest.xml file.

In this How to Get Registered Email Address Programmatically in Android example, you will get all necessary XML and Java code.

Get Registered Email Address Programmatically in Android


Following is the content of XML layout file and java activity file.

XML Layout File


res/layout/get_email_programmatically.xml

Java Activity File


src/GetAndroidLogInEmail.java


AndroidManifest.xml File


AndroidManifest.xml

Strings.xml File


res/values/strings.xml


How to Get Registered Email Address Programmatically in Android

Finally, you have done all things. Now, run your Get Registered Email Address Programmatically in Android application, you will see registered android device email address in the screen and in toast message.
Tutorial 1458807403954715013
Home item