T
T
TechNOIR2019-07-10 15:23:06
Android
TechNOIR, 2019-07-10 15:23:06

Android. How to programmatically click on a physical device button?

Good afternoon.
Tell me please. How to programmatically click on a physical device button?
Let's say through adb this can be done, as I understand it, "adb shell input keyevent 4" (substituting keyevent people).
How to do it from the program? Well, let's say I threw two buttons on the form, one should increase the volume of the other to decrease it. How to bind them to physical buttons on the device?
thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2019-07-10
@402d

https://android--code.blogspot.com/2018/04/android...
https://play.google.com/about/privacy-security-dec...
settings make changes to device settings or other applications without the knowledge and consent of the user. Settings include system and browser settings, bookmarks, shortcuts, home screen icons, and app widgets.
In addition, the following is prohibited.
Applications that change device settings or features with the user's consent, but in a way that cannot be easily undone.
If desired, the volume control can be pulled under this item. Since you want to change the mastervolume, not the volume in your application

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question