Unable to connect to ejabberd server using smack api -
i trying connect ejabberd server , using smack api. below code connection server. after setting username, host, , localhost service, trying show toast whenever connected. on debugging, neither toast shown nor exception... please have @ code below
xmpptcpconnectionconfiguration config = xmpptcpconnectionconfiguration.builder() .setusernameandpassword("alien@localhost", "alien") .setservicename("localhost") .sethost("192.168.1.xx") .setport(5222) .setdebuggerenabled(true) .build(); abstractxmppconnection conn2 = new xmpptcpconnection(config); try { conn2.connect(); conn2.login(); if(conn2.isconnected()) { toast.maketext(chatclient.this,"isconnected",toast.length_long).show(); } else { toast.maketext(chatclient.this,"failed",toast.length_long).show(); }
following dependencies have used in project,
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.1' compile "org.igniterealtime.smack:smack-android:4.1.0" // optional xmpptcpconnection compile "org.igniterealtime.smack:smack-tcp:4.1.0" // optional xmpp-im (rfc 6121) support (roster, threaded chats, …) compile "org.igniterealtime.smack:smack-im:4.1.0" // optional xmpp extensions support compile "org.igniterealtime.smack:smack-android-extensions:4.1.0" }
my domain ( 192.168.***.2*:5280/admin )..thank in advance :)
Comments
Post a Comment