Intercepting the headset button press - Android Q&A, Help & Troubleshooting

I have Plantronics Backbeat Pro 2 bluetooth headset, it has few buttons:
play/pause
prev track
next track
button with few functions: single press - call/end call, double press - call last number, long press - voice search
Is it possible and how is it possible to intercept in code various presses of the last button described?
Intercepting MEDIA_BUTTON intents works only for first three buttons. onKeyDown also doesn't work.
I read that the headset communicates with the phone via AT commands. The second question is: Is it possible and how is it possible to intercept this commands?
Target phone is: Xiaomi Redmi Note 4X, rooted.
I will be glad of any help.

Related

[Q] Custom Bluetooth headset button actions?

Did a quick search and found nothing -- is there any application or way to customize the actions performed when the headset button is pressed?
I use Tasker for various automated things, but looks like there's nothing there (did I miss something?).
Specifically, this is the button on a bluetooth headset that would normally start the voice dialer -- I'd like it to do something different, perhaps. I know that the button's "command" can be intercepted by some applications, because I know that Vlingo, when installed, becomes an option of an application that would "handle" the bluetooth button press (i.e. when I press it, it pops up a window for "which application do you want to use for this").
Unfortunately, Vlingo just uses this to launch its own voice dialer...
Thoughts? If it matters, I'm using the Galaxy Nexus on ICS.
Thanks!
*bump*? ^_^
bump? Anyone? =/
I'm interested in knowing whether there's a solution for this as well, I'm wanting Jeannie/assistant called when I hit the call button on BT headset.
I know this is old but I'm look for a option to do this. Running a old stereo deck in my car but is bluetooth enabled and would love to have something trigger Google Now or Voice Dialer. Possibly by long pressing the play button or something.

How active Svoice from headset?

I'm using stock/ original in-ear headset with mic and volume control..
How can I start/active sVoice from it?
Thanks
up
UP
up
Follow up
I don't have a SGS3 yet, but I am wondering about these little details as well as they will determine the usefulness of SVoice...
If the phone is locked (in my pocket) and connected to a headset with a one button mic, can the button be used to activate SVoice? If so, is it a double tap of the button?
Obviously SVoice may choose to prevent you from doing certain things while locked (dialing numbers, etc), but it would be great to play a playlist or toggle shuffle for the music app using SVoice while the phone is in my pocket.
Likewise, if the phone is in a car dock, but the screen turns off/locks, can I still double tap the home button and voice a command for music control or reading my text messages?
Bump?
wondering about this too, i can't make it work......
workaround
chauzu said:
wondering about this too, i can't make it work......
Click to expand...
Click to collapse
it was annoying me having come from iPhone to note 2 so the way that I have made it work was to get the app headset button controller from the play store and set 4 clicks to launch so voice, make sure you select yes to waking the phone when asked. Now s voice works on the headset, just wish I could assign it to long press of the headset button but that's reserved for google voice search. I hope this can help some people or if anyone has a simpler workaround please share!

[Q] How to set the action for the button on the BT headset

Hi,
i connected a bt headset to my S3, i has one button. When i press the button the phone makes a redial of the last no. on the list. How do i change the action of the button so that it starts s-voice for example.
thanks a lot
syd...

[Q] Headphone fast forward double tap not working

Hi,
can anyone tell me how to fast forward when using the headphones when i double tap all it does is call the last dialled number.
I have installed headset button control trial and double tap works but not all the time.
Having same issue, guess that's just how sense is. I don't like.
Sent from my HTC One using xda app-developers app
I just got my phone yesterday, coming from Galaxy S3, and am having the same issue.
If no music program is running and I press the button on the remote, it starts the music program (google music) and plays a song.
If I press the button while music is playing, it pauses/resumes the song.
If i double press the button while music is playing, it stops the song and dials the last number.
If I i plug my 3 button Galaxy S3 headphones with 3 button remote into the HTC one, all 3 buttons (Previous, Next, Middle button) work.
How do I get the stock headphones to be able to skip to the next track?
I was having the same kind of issue, when double pressing the button to skip to the next track it will dial the last number called (when you end the call it does skip the track)
After researching I found this: which then made me believe the One has the same issue
http://forums.androidcentral.com/htc-one-x/175730-next-song-double-tap-call.html
I've been using the app "Headset Button Controller" and it's been working fine since

Wired Headset Button Events

Hi,
I am trying to understand, how android os or audio layer interprets 2 taps of button A as skip to next track event. Here is the website for reference
https://source.android.com/devices/accessories/headset/expected-behavior
When user presses the middle button on wired headset, the os will receive
Keyevent ACTION_DOWN, KEYCODE_MEDIA_PLAY_PAUSE
keyevent ACTION_UP, KEYCODE_MEDIA_PLAY_PAUSE
twice in sequence and somehow that gets converted to MEdia_next event so that players like vlc skip to next track in the Playlist
I don't think it's the app doing anything but the os in the middle interpretating those events in sequence as next event.
Can someone help me where should I look
Regards

Categories

Resources