I’ve seen references to using the AccountManager like Accessing Google Account Id /username via Android. But it seems like it’s for grabbing the authtoken?
I just need access to the username, no passwords or any auth tokens.
I’m using android 2.1 sdk. How can I get the google username on Android?
As mentioned in the comments, Roman’s answer to How to get the Android device's primary e-mail address solves it.
Here’s the code i used that will also strip out the username from the email.