Using Smack 4.1 Readme and Upgrade Guide
Using Android studio 2.3, Recently I have implemented a demo in a very simple way.
-> Just Add gradle dependency in app level gradle as below
compile "org.igniterealtime.smack:smack-tcp:4.1.0"
// Optional for XMPPTCPConnection
compile "org.igniterealtime.smack:smack-android-extensions:4.1.0"
-> Configure Connection Configuration
NOTE : Call this in AsyncTask or in other background thread
XMPPTCPConnectionConfiguration config = XMPPTCPConnectionConfiguration.builder()
.setUsernameAndPassword("Your Username here", "Your Password here")
.setHost("Host name here")
.setServiceName("Your service name here")
.setPort(Your port number here)
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled) //Disable or enable as per development mode
.setDebuggerEnabled(true) // to view what's happening in detail
.build();
-> Use isConnected()
and isAuthenticated()
-> Use ChatManager
for add chatListener
.