I need to bind some phone HW button to start my application.
It should be done from the code of the application or when installing it.
Is it possible in Android?
I need to bind some phone HW button to start my application. It should
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t bind an application to a key like creating shortcut keys in desktop applications.
If your app is not running then only way it can be invoked other than manual press on launcher icon, is by Broadcast Receivers only. But no key press is broadcasted in Android.
One way to achieve this by running a Service in foreground which watches for Key Presses and can initiate your app when specific Key combination is pressed. But not recommended because user may not like this.