I am developing an android app for mobile device management system - which needs to mainatan a persistent connection to a web server through https connection and wait for any commands from the server. Can some please help me in the design of this app? Below are few of the question I had:
I am planning to create an intent service which opens a https connection and making it persistent by setting the connection property as : conn.setRequestProperty("Connection", "keep-alive"). Will this guarantee a persistent connection?
How can the app receive commands from the server execute them and respond back to the server. A simple command for execution could be to "fetch device info". Once the server sends the command, the app should fetch basic device info and reply back with a JSON object.
After the response, does the connection close? Or will it remain opened? I want it to remain opened to receive the next command from the server.
Any suggestions/pointers would be deeply appreciated!
Thanks.