I am writing an application that requires to retrieve the android username [email protected] from the phone. I have been looking at AccountManager class. This is what I have for now in my code.
AccountManager accountManager = AccountManager.get(this);
Account[] accounts =
accountManager.getAccountsByType("com.google");
String email="";
email=accountManager.getUserData(accounts[0], accountManager.KEY_USERDATA);
However, I am getting a caller uid 10085 is different than the authenticator's uid exception. Anyone knows how to do it?
PS. I don't need password or authentication token, I just need the username.
Select “Settings” near the bottom of the pop-up menu. Locate and tap on “Passwords” partway down the list. Within the password menu, you can scroll through all of your saved passwords.
Click the "Manage Saved Passwords" link. Chrome will display all of the saved usernames associated with saved passwords; however, Chrome will not display any usernames saved without a password. To view those usernames, you will need to check each individual website.
Your passwords can be stored on an Android phone or tablet using your Google Chrome app. The passwords stored in the Google Chrome app are linked to your Google account, so you can access them through Google Chrome on a Mac or PC as well.
Username is available to you; just use:
String email = accounts[0].name;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With