Reputation: 1095
I'm looking for a method that returns me the Google Checkout User Account of the owner of the telephone...
I explain: when I buy an application over the market, in the phone is stored somewhere the Google Account that I use to purchase the app (that maybe can be different from the main google main account?). I need a method, if exists, that gives me this account (only the username, I don't need the password!).
Thanx in advance
Upvotes: 0
Views: 428
Reputation: 1095
AccountManager accountManager = AccountManager.get(this);
Account[] accounts = accountManager.getAccountsByType("com.google");
googleCheckoutUser = accounts[0].name.trim();
Upvotes: 1
Reputation: 7003
That doesn't exist. The notion of what Google account is used for Market login assumes the device has a Market application, and that's not guaranteed.
An application wanting access to another's private data must be signed with the same key and the applications must have made provisions to share a UID. This article has a nice overview of how all of this works.
Upvotes: 0
Reputation: 10106
I don't think you can retrieve that information, since I would consider it to be private data.
Upvotes: 0