2

I want to add a gmail account in to a android device using my application.

in my application having 2 Edit Text,

Username(for getting username like user1@gmail.com) n

Password(for getting password like *********)

and have a button

AddAccount(for onclick listener)

when i click the button it should add a gmail account in to gmail account.

(By the way i have done this Here answered by ben and working well, But its not working for add a gmail account).

plz give suggestion. Thanks in advance.

Community
  • 1
  • 1
Mohanraj S K
  • 657
  • 4
  • 16
  • You mean **Bean** 's answer worked for any other account except `Gmail`???? – SweetWisher ツ Jul 10 '14 at 16:42
  • Which means from the Bean's answeradd a new category of account like Google, FaceBook.The selection of accounts will shown "MYPACKAGE" as a account type. – Mohanraj S K Jul 11 '14 at 04:24
  • 2
    Finally i understood it cant allowed by gmail bcz of security reason. so Beter we use this code to add an account in android device. **AccountManager acm = AccountManager.get(getApplicationContext()); acm.addAccount("com.google", null, null, null, GmailLogin.this, null, null);** – Mohanraj S K Jul 11 '14 at 04:32
  • @Mohanraj Any idea why it cannot be done for gmail. Any link for documentation/details regarding this? – user1429322 Sep 08 '15 at 00:37
  • @user1429322 gmail won't allow to add like due to security reason. but it allows to reroute the device's add gmail account window. that's a only way to do from my experience. :) – Mohanraj S K Sep 09 '15 at 07:11

0 Answers0