I have openfire installed on remote server. I can connect to it using the Spark XMPP client. But I am getting connection error when I use my Android XMPP client. Here is the connection code part of the Android client application:
// Create a connection
String serverIp = "14.63.XXX.XXX";
ConnectionConfiguration connConfig =
new ConnectionConfiguration(serverIp, 5222);
connConfig.setSASLAuthenticationEnabled(true);
XMPPConnection connection = new XMPPConnection(connConfig);
try {
connection.connect();
Log.i("XMPPClient", "Connected to " + connection.getHost());
} catch (XMPPException ex) {
Log.e("XMPPClient", "Failed to connect to " + connection.getHost());
Log.e("XMPPClient", ex.toString());
xmppClient.setConnection(null);
}
try {
connection.login(username, password);
.......
I am getting error when connection.connect(); is executed. I checked the port at the server and its open. I also tried 5223 port. I checked the permission on XMPP client also. I googled it and couldn't find a solution that fix this problem. Can anybody please suggest me what to do?