I am developing an android application where socket communication is using between client and server. Its working fine in normal case. I want to keep alive socket connection with server for receive data in background also even if application get closed.
I created service where socket connection has been initialized.My service has been restart if my application has been closed because I have used "START_STICKY" that is fine. But After restarting service my service could not able to communicate with activity when I received some request from server.
How Can achieve this feature in my application if my application is closed it should be able to receive data from server and act as per that.
Please help me to design this communication.