Apps start app with power button

drcspy

Lurker
Hello people

New to android programming and I would like to create an app that runs when the power button is pressed (the phone will already be 'on' as such but the screen 'off')

so - one press of the power button to 'activate/show' the screen will make the app run (without requireing the user to unlock the screen please).

is this possible

how do I capture the 'power button press' event and then direct it to run *app xxx*

I thank you for your time in lookin at my question and I sincerely hope I can also one day help others (I have a fairly extensive history online of helping people with windows and hardware issues)
 

sohguanh

Android Enthusiast
As usual most ppl will recommend you to master Tasker. For your case it will be like what you say, if power on button then start app xx. Some recommend Llama though.

Btw I am curious why you need such behavoir? You want to track how many times the user power on the button in some background service?
 

drcspy

Lurker
Thread starter
sohguanh nope I'm just wanting to activate an app that uses voice to notify the user of an event/process/ etc wihtout having to log in to the screen as such
 
Top