2

I have a code in my app that prompts user to add Google account if one is missing.

AccountManager accountMgr = AccountManager.get(mContext);
accountMgr.addAccount("com.google", "ah", null, new Bundle(), 
    (Activity) mContext, null, null);

This works as intended on any "Google-enabled" device, however on NOOKColor code executes with no error or warning however Account Manager never starts since UI for it is probably missing. Can you think of any good alternative? All I need is to obtain AUTH token for the user's Google account to be able to access Google Reader

Cœur
  • 37,241
  • 25
  • 195
  • 267
Bostone
  • 36,858
  • 39
  • 167
  • 227

1 Answers1

1

You can't do this. The AccountManager is just a facade, there needs to be an actual Google account implementation. You get this only on 'Google experience' devices with Market/Play pre-installed.

If you need to get a token for a Google API service, you can use the APIs directly BTW, "ah" is for App Engine, not Reader.

Nikolay Elenkov
  • 52,576
  • 10
  • 84
  • 84
  • The Web APIs: ClientLogin, OAuth, etc. Details here: https://developers.google.com/accounts/ – Nikolay Elenkov Apr 20 '12 at 02:49
  • Unfortunately, I don't think I can use this since I'm targeting Reader which does not appear at list of services in client console – Bostone Apr 20 '12 at 03:23
  • You should be able to get token using client login. Examples: http://code.google.com/p/google-reader-api/wiki/Authentication – Nikolay Elenkov Apr 20 '12 at 03:24
  • No way I'm collecting names/pwd for Google - that pretty much guarantees many single star ratings on the market, no I have to stick with OAuth – Bostone Apr 20 '12 at 05:22
  • You can get an OAuth token as well. Might be a bit trickier to integrate in your app though. – Nikolay Elenkov Apr 20 '12 at 05:30