I want to create an application which listens to events from a specific button (hardware button) and triggers some event.
For example, think about a PANIC button function, when some button is kept pressed for 5 seconds, this will trigger some ALERT (suppose sending an sms message).
I have not yet found a way to make this.
Please keep in mind that this MUST BE a HARDWARE BUTTON and not a software button (might in an activity).
Thank you very much.
In your own activity, you can watch for whatever buttons you want via
onKeyDown()
.Outside of your own activity, what you want is not possible, except via firmware modifications.