Bostone
Bostone

Reputation: 37126

Android - add Google account programmatically to non-Google device such as Nook

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

Upvotes: 2

Views: 693

Answers (1)

Nikolay Elenkov
Nikolay Elenkov

Reputation: 52936

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.

Upvotes: 1

Related Questions