powered by Jive Software

How can i keep connection to openfire server always open even when activity is closed (android)

Hi all please i am working on an android chat application with smack 4.2.2 client, chat message works fine but sometimes socket connection to the server is closed. Please how can i keep an unending open connection to the server for as long as i want?.. Any help will be appreciated.