android - How can I replicate Bluetooth devices sending key presses to listening apps? -


i want replicate behavior of bluetooth headset, if button on pressed sends "play-pause" command phone. doesn't know receive command --- whether it's music app a, music app b, video player, etc --- yet still works.

i want create program can same thing (but programatically). however, i'm running issue can't seem find way inject key events whatever listening them.

to clear, i not listening these events, want send "play_pause" event whatever app listening it.

there must way, since bluetooth keyboards, headsets, etc able it. assume have root access (and potentially own system image on phone, though i'd rather not go far). how can accomplish this?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -