I am trying to connect to openfire using this code

configuration=XMPPTCPConnectionConfiguration.builder();

configuration.setServiceName(“192.168.1.53”);

configuration.setPort(5222);

configuration.setSecurityMode(SecurityMode.disabled);

//connection.setPacketReplyTimeout(30000);

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

try {

connection.setPacketReplyTimeout(30000);

connection.connect();

getting eror:

04-18 13:13:05.084: E/error(1424): SASLError using DIGEST-MD5: not-authorized

you should set the username and password like this (smack 4.1.0):

configuration = XMPPTCPConnectionConfiguration.builder()

** .setUsernameAndPassword(“username”, “password”)**

.setServiceName(“your.server”)

.setHost(“your.server.ip”)

.setConnectTimeout(3000)

.setSendPresence(false)

.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)

.build();

connection = new XMPPTCPConnection(connectionConfig);

connection.connect();