Umesh Kumhar
Umesh Kumhar

Reputation: 816

how to add google account programmatically in android with one click in background?

i am trying to add google account programmatically to android using a app that takes username and password and logins the user in background. But i m having problem as it is showing error...

Error: Caller uid 10024 is different than authenticator's uid .

I had already included all permissions and authenticator xml but it is not responding... plz help i want to add google account in backgroundwith one click ..

Thanks in advance..

      Account acc = new Account("[email protected]", "com.google");
    AccountManager am = AccountManager.get(this);
    Bundle userdata = new Bundle();
    userdata.putString("SERVER", "extra");

    if (am.addAccountExplicitly(acc, "mypass", userdata)) {
        // success message..
    }

Upvotes: 2

Views: 1393

Answers (1)

Umesh Kumhar
Umesh Kumhar

Reputation: 816

Basically this would be impossible to do because adding an new google account without the prior information of the user itself would definetely be a kind of malware or theft app.

Therefore according to Google this would lead to violate the user freedom and its trust towards Android operating system.

But you can add new google account and can ask user to enter the password for that account. So there will be no permission violation.

Upvotes: 3

Related Questions