Search code examples
androidaccountmanagernook

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


Solution

  • 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.