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();