I am working on a mobile application which connects to OpenFire server. As the mobile network connection might not be stable, there are frequent disconnections from internet. As a result of this, messages are not delivered to users on mobile devices and I need to check for connection and re-connect every 15 seconds.
Is there a way to implement this in a better manner and handle it more effectively?