Detection of Power Button Click

I want to detect if the power button is clicked thrice.
I don't see anyways on the app inventor to overcome this problem.
Can anyone suggest any ways/extensions for this?

Do you want to know if a button is clicked three times ? If so you use a global variable to count the button clicks… after 3 clicks ...


1 Like

No not really, I want to detect the click of the power button the one which you have to click to open your phone.

you can't you need to learn java. And create a extension Using BroadcastReciever

How do we create this?

It may not be possible to detect a (physical) power button tap Amrish.

To create an extension:


I want to create an app which can detect if power button is pressed three times continuously within 10 seconds then need to send sms or whatsapp of the location as SOS.

Can someone help me with extension if any or how do I build one.

There is no vanilla way to do this. As you've been pointed to multiple times, you can create an extension using Rush:

You'll need to extend the BroadcastReceiver class in your extension: