How to send <resume.../>

when the client got ‘unclean’ disconnection from the WiFi / GSM,

doesn’t send

stanza after reconnecting

always:

D/SMACK﹕ SENT (0):

D/SMACK﹕ RECV (0):

if the client got ‘unclean’ disconnection from the WiFi / GSM ,

what should I do when the client reconnection ?

just connection.connect(); connection.login(); ?

my code:

XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();

builder.setHost(service);

builder.setPort(port);

builder.setUsernameAndPassword(jid, pwd);

builder.setServiceName(service);

builder.setDebuggerEnabled(true);

builder.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);

if(connection == null) {

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

}

XMPPTCPConnection.setUseStreamManagementDefault(true);

XMPPTCPConnection.setUseStreamManagementResumptiodDefault(true);

connection.setUseStreamManagement(true);

connection.setUseStreamManagementResumption(true);

try {

connection.connect();

connection.login();

} catch (Exception e) {

e.printStackTrace();

}

build.gradle:

dependencies {

compile fileTree(dir: ‘libs’, include: [’*.jar’])

compile “org.igniterealtime.smack:smack-android-extensions:4.1.0”

compile “org.igniterealtime.smack:smack-tcp:4.1.0”

compile “org.igniterealtime.smack:smack-experimental:4.1.0”

compile “org.igniterealtime.smack:smack-android:4.1.0”

}

Duplicate of stream management