Xmppconnection Error In Android
Solution 1:
ConnectionConfiguration config = new ConnectionConfiguration("chat.facebook.com", 5222,"chat.facebook.com");
XMPPConnection myConn = new XMPPConnection(config);
config.setSASLAuthenticationEnabled(true);
config.setDebuggerEnabled(true);
try{
myConn.connect();
//username is no @chat.facebook.com
myConn.login("rajeshXXXXX","XXXXXXX" );
}
catch (Exception e) {
System.out.println(e.toString());
}
//Its working fine for me finally, use asmack-2010.05.07.jar git://gist.github.com/925250.git
Solution 2:
I got this error after I updated the android plugin for eclipse as well as the android SDK tools/platform-tools (my project worked fine before I updated).
To fix I went to Properties -> Java Build Path -> Order and Export Tab. I checked the box next to the asmack jar I am using (the one from BEEM). Then I moved it to the top. Originally it wouldn't work unless it was at the top so make sure you try that.
Solution 3:
It seems like you are using Ignite's Smack API. The original Smack API is intended for desktop usage and uses the Java Naming and Directory Interface (JNDI) that is used for LDAP and other directory-related stuff. JNDI is not included in Android, i.e. the package javax.naming does not exist. There is an Android port called asmack which will work for you. You simply have to replace the Smack jar by asmack's jar.
You can find asmack here: https://github.com/flowdalic/asmack
Post a Comment for "Xmppconnection Error In Android"