views:

737

answers:

1

How do you access the user's Google Account Id / username in code? I building am application that will call a web service to store data and I want to identify the identity of the person sumitting the data.

+5  A: 

The account manager class has access to this.

http://developer.android.com/reference/android/accounts/AccountManager.html

sadboy
Where does the AccountManager class reside. I'm developing for version 1.5 and I can't find this class.Here's the code I'm starting with from developer.android.com site.AccountManager accountManager = AccountManager.get(context);
KawBoy
I found where the AccountManager class is new to 2.x. Is there a forward-compatible way to do this in 1.5?
KawBoy
can you clarify how to use AccountManger.get(context)? What do i use as the context? if i use .get(getBaseContext()), it just returns null.
tommy chheng