0
votes

as the title says I'm new to android. I'm trying to build very simple chat with the following code.

//1. connection
ConnectionConfiguration connConfig = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
try{ connection.connect();}
catch (XMPPException ex)
{   
 connection = null;
 return;
}

//2. login
try{  connection.login(myGmailLogin,myGmailPwd); }
catch (XMPPException e)
{
  report+="Login error " + e.toString() ;
  return;
}

What i get Is: Login error SASL authentication failed using mechanism PLAIN. By googling i've found dozens of pages from people having the same problem but no solution worked. can anyone please help me? thanx a lot!

1
Btw I assumed that I can use my gmail login and password is that correct?!? - Luca

1 Answers

0
votes
  1. Use ConnectionConfiguration connConfig = new ConnectionConfiguration("gmail.com");, all other params will be set automatically
  2. Google does not allow PLAIN authentication on the insecure connection, make sure TLS connection is required: connConfig.setSecurityMode(SecurityMode.required);