Android xmpp client connection with xmpp server using Smack 4.1

Hello Everyone,

i have followed a simple tutorial for creating a chat app using xmpp. from this site -> Building your own android chat messenger app similar to Whatsapp using XMPP (Smack 4.1 API) from scratch: Part-1| Tutor… which uses smack 4.1 and don’t know which server

followed all steps and compiled with success. after but running app it forcly closed…

tried to debug and found problem in snippet of code below ( ClassName -> MyXMPP.java).

no further progress after initializing “config”.

private void initialiseConnection() {

Log.d(“tag”, " before initializing config");
XMPPTCPConnectionConfiguration.Builder config =XMPPTCPConnectionConfiguration.builder();
Log.d(“tag”, " after initializing config");

config.setSecurityMode(
ConnectionConfiguration.SecurityMode.disabled);
config.setServiceName(serverAddress);
config.setHost(serverAddress);
config.setPort(5222);
config.setDebuggerEnabled(true);

XMPPTCPConnection.setUseStreamManagementResumptiodDefault(true);
XMPPTCPConnection.setUseStreamManagementDefault(true);

connection = new XMPPTCPConnection(config.build());

XMPPConnectionListener connectionListener = new XMPPConnectionListener();
connection.addConnectionListener(connectionListener);
}//end

LogCat Comments:

11-23 20:08:22.390 28463-28463/com.marothiatechs.myapplication D/tag: before initializing config

i am new to android, xmpp and this blog.

tried hard to find some solution but couldn’t…

Would be very thankful if anyone can help out with this problem…
Thanks ind advance.
Screenshot attached.