开发者

Retrieving users registered gmail that he/she uses to login to market?

As topic says. I want to get the email a user has registered on their pho开发者_运维问答ne to log on into android market. This due to the fact that my application connects to a remote database that´s supposed to store who have done a specific thing in the app..

I´ve searched the web for similar problems, but i have´nt found a possible solution yet.. :/

Does anyone have a nice codesnippet that shows how to do this?

Thanks in advance!

/ Alex


You want AccountManager

Account[] accounts = AccountManager.get(this).getAccounts();

for (Account account : accounts) {
  // TODO: Check possibleEmail against an email regex or treat
  // account.name as an email address only for certain account.type values.
  String possibleEmail = account.name;
  ...
}

But AFAIK, there is no way to see which one is being used in the market. Assume that the first gmail account (use regex) would likely hit 99% of users.


Due to security issues, you will not be able to just "get" that info. You have to ask for it from the user. That is why they implemented the "authentication tokens", so you don't need to know their email, you just store the token.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜