I am working on an application that runs a service. This service starts automatically when the system boots or the app is started. My manager asked me to check if it is still running periodically (eg. every 5 minutes) or each time the screen is turned off and then start the service again if not running.
The closest solution I found was this: http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/
This restarts the service only if the application is still running, which is unlikely if the user stopped it or killed it with some task manager.
Is it possible to have the service restarted other than boot-up or activity registered receiver? (Thinking about it as a User, I would not really like to have an application running all the time weather I wanted it or not.)