I am creating a Panic Alert application on Android for which I want the service to start in the background and acquire Partial-Wake-Lock to start, even when the screen is off. I want this service to listen for a volume key (or a combination of power and volume keys) by pressing for 3 seconds or more to start the service by sending panic messages.
Can I listen to key events by tying my service to any other system service? Or is there any other way to achieve my goal?
source share