Can I store the AbstractXMPPConnection object in Android?

I am currently using Smack 4.4.6.
I thought about storing the AbstractXMPPConnection object locally on Android so that the next time the same account establishes a connection, I can call the AbstractXMPPConnection object directly locally. I’ve tried using SharedPrefernce and GSON for storage, but failed. Because XMPPConnection is serialized. Is there any other way, or is my idea unattainable?

Why do you want to serialize connection object? What do you accomplish by that?

Save the XMPPConnection object that has already called the login() method and call it directly locally next time.

I don’t see advantage at all. Store the connection as object of the App class.
When in an activity, then check if it is logged in then continue. If not launch login page or send token for login, if your server is set to accept token

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.