Android - Add Account
YouTube solution
Update: as posted by Derek in the comments and by some other people in various help forums:
- Add your account in the YouTube app, no password needed
- Go back to the homescreen, Menu -> Settings -> Accounts & sync
- Set sync settings there and put in the password when prompted
Reportedly this works for most people who have tried it.
If it doesn't work and for those interested, here's my original little workaround project:
App solution
There's a bug in Android currently (up to 2.1) where you can't add more accounts anymore. The usual error is:
Can't establish a reliable data connection to the server.
The solution is to do a factory reset and add your new accounts on the fresh system, which usually works. Not very comfortable.
I recently had the same problem again, even did a reset and still couldn't get it to work, so I tried to solve it by doing it manually in an app. Luckily that was successful.
I don't know whether there are dangers in this or some important initialization isn't done. But it works fine for me.
I put up the source code and a compiled app package, see downloads. Use at your own risk.
Update
- version 1.1 catches exceptions if there are any and displays them, let me know if there are any, maybe it requires some adjustments to work on some systems
How To
- Install the app. To install the app it's easiest to download something like "Apps Installer", copy AddAccount.apk to SD card, open with the installer. I think ASTRO can do it directly also.
- Run it.
- Add an account.
- Go to Android Settings -> Accounts, enable sync... that FAILS, because no password is given yet, so go to the notification bar for the error, then type in the password. Et voilà, the account is added.
That is all. I hope it's helpful.
Note: some people have reported an error like this:
Error: java.lang.SecurityException: caller uid 12345 is different than the authenticator's uid.
I'm not sure yet why this happens for some and how it could be fixed.
Code
The relevant snippet:
AccountManager man = (AccountManager) getSystemService(ACCOUNT_SERVICE);
Account account = new Account("somewhere@domain.com", "com.google");
if (man.addAccountExplicitly(account, null, new Bundle())) {
// worked
} else {
// guess not
}
As you can see there is no password given.
Note that this does no checks whatsoever about the validity of the account or the password. That'll be done after the reboot. The snippet really just ADDS the account dumbly.
Comments
Show all commentsIngerMaaike 11:11 September 24, 2011
It does indeed add the acounts but keeps hanging on authenticating so will not sign in. But it is a step forwards :)
topas1911 06:32 November 27, 2011
It does indeed add the acounts but keeps hanging on authenticating so will not sign in.
topas1911 06:34 November 27, 2011
Edit: Running Adamcomb 0.3
hanoi-vietnam-travel 13:42 December 25, 2011
Invite you to visit the blog http://hanoi-vietnam-travel.typepad.com/
vahan 13:51 February 05, 2012
i llllloooove you for this.thank you very much.
Toad 17:39 July 30, 2010
And how to install it? What file do I need to download and install? Can you give us an Step By Step?