Custom Stream Management ID

Hi,

If I enable Stream Management, everything works fine as long as the app is not killed. If the app got killed, the SM Id is not available anymore and Smack cannot resume the stream: messages sent after the app got killed and before it got restarted are lost.

So my question is: is Smack able to get and set the SM id? That would be something like this:

String smId = retrieveSmId(); // Internal function to get SM id from preferences if (smId != null) connection.setSmId(smId); connection.connect(); connection.login(); String newSmId = connection.getSmId(); storeSmId(newSmId); // Internal function to save current SM id into preferences

Thanks!

I think I know what you try to achieve. But if my guess is right, then your approach of restoring (just) the SM ID is not sufficient.

I just want to resume an existent stream in Android after a force close: when I restart the app, Smack cannot resume the stream because latest SM id isn’t known. What should I need in addition to the latest id to achieve this?

What should I need in addition to the latest id to achieve this?
The outgoing stanzas which where not ack’ed.