I launched openFire and tested it with a spark, everything is fine, but when I try to connect to smack 4.2.0 in android studio, I got this error:
Ljavax / naming / directory / InitialDirContext;
and my dependencies are as follows:
compile "org.igniterealtime.smack: smack-java7: 4.2.0" compile compile org.igniterealtime.smack: smack-tcp: 4.2.0 "org.igniterealtime.smack: smack-im: 4.2.0" compile "org. igniterealtime.smack: smack-extensions: 4.2.0 "compile" org.igniterealtime.smack: smack-android-extension: 4.2.0 "compile" Org.igniterealtime.smack: slap-bosh: 4.2.0 "
when remove this: "compile org.igniterealtime.smack: smack-java7: 4.2.0" from the dependencies and add this: compile "org.igniterealtime.smack: smack-android: 4.2.0" my dependencies become like this:
compile 'com.android.support:appcompat-v7:24.0.0' compile "org.igniterealtime.smack: smack-android: 4.2.0" compile Compile org.igniterealtime.smack: smack-tcp: 4.2.0 "org. igniterealtime.smack: smack-im: 4.2.0 "compile" org.igniterealtime.smack: smack-extensions: 4.2.0 "compile" org.igniterealtime.smack: smack-android-extension: 4.2.0 "compile" Org. igniterealtime.smack: Slap Bosch: 4.2.0 "
I got this error:
org.jivesoftware.smack.SmackException $ConnectionException: : '192.168.209.2:5222' , : de.measite.minidns.hla.ResolutionUnsuccessfulException: 192.168.209.2. IN A NX_DOMAIN, '192.168.209.2:5222' , : de.measite.minidns.hla.ResolutionUnsuccessfulException: 192.168.209.2. IN AAAA NX_DOMAIN
, connect.connect():
XMPPTCPConnectionConfiguration config = null;
try {
config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword("admin", "thepass")
.setXmppDomain("192.168.1.3")
.setHost("192.168.209.2")
.setPort(5222)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.build();
} catch (Exception e) {
e.printStackTrace();
}
AbstractXMPPConnection conn1 = new XMPPTCPConnection(config);
conn1.setReplyTimeout(60000);
conn1.setPacketReplyTimeout(60000);
conn1.connect();