1

Strangely there isn't a question on SO regarding this topic. At least I couldn't find one.

Like Windows & Linux, Android too allows us to have multiple user accounts on the same device/computer:

android multi users

Each user is the FIRST (or primary) Google account with which the device/user partition was activated. Hence, one way to get the name/email associated with this user is through Google Sign-In:

google sign in pick account dialog

My question is, is there a way to get at least the name (if not the email) of the device user? Without using Google Sign-In, which requires both the Play Services library and the GET_ACCOUNTS permission?

There should be some Android API or Provider that tells us the name of the current device user. I've already looked at the following documents:

Supporting Multiple Users

Manage multiple users

AccountManager

.... and I couldn't find anything there.

Does anyone know of a way to get the name/email of the primary Google account on the current user/partition? WITHOUT Google Sign-In, which requires Play Services? Is there some Java/Android API that gives us the account details for the current user?

Related:

1. How to get active account Id in android multi user

2. How Gmail does it

3. Getting it without the GET_ACCOUNTS permission

4. Getting Android owner's email address nicely

Yash Sampat
  • 30,051
  • 12
  • 94
  • 120
  • Please try https://stackoverflow.com/questions/2112965/how-to-get-the-android-devices-primary-e-mail-address – Avinash Jan 27 '20 at 07:29
  • Android users and accounts (e.g. google accounts) are completely irrelevant. Refer to https://source.android.com/devices/tech/admin/multi-user#general_defs for definitions. Searching about users will not help you reach your purpose. – mahdi May 10 '22 at 14:45

0 Answers0