Android Service keep alive

Viewed 18927

I have a small chat application. When it starts it binds to a service. This service has a tcp/ip connection with the server.

When the application is not in foreground my service creates a status notification. So far so good.

When the application is destroyed for example using task manager on "onDestroy" method I call unbind. Now the service is killed. So my question is how I make a service to stay alive even there is no clients bind with it.

Googe doc: " The service will remain running as long as the connection is established (whether or not the client retains a reference on the service's IBinder)."

Thanl you.

3 Answers
Related