标题说我是android的新手。 我正在尝试使用以下代码构建非常简单的聊天。
//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;
}
我得到的是:登录错误使用PLAIN机制SASL身份验证失败。 通过谷歌搜索,我发现有几十页来自有相同问题但没有解决方案的人。 谁能帮帮我吗? 非常感谢!
答案 0 :(得分:0)
ConnectionConfiguration connConfig = new ConnectionConfiguration("gmail.com");
,
所有其他参数将自动设置connConfig.setSecurityMode(SecurityMode.required);