I want my service to start automatically when the device goes to sleep and also when it wakes up. How do i do it without making the service run continuously in background to check the state of device?
For example, can i add my service to the list of system default services that get started up when a device wakes up?if so, how to do it?