Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
headset button
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brodsky  
View profile  
 More options Jan 30 2009, 2:20 pm
From: Brodsky <peter.brod...@gmail.com>
Date: Fri, 30 Jan 2009 11:20:39 -0800 (PST)
Local: Fri, Jan 30 2009 2:20 pm
Subject: headset button
Hi!  Does anyone know how to tell when the headset button is being
pressed?  I'd like to support the usb headsets and possibly bluetooth
headsets.  My app is a media player and ideally, I could register it
somewhere so that if no app that uses the headset button has focus it
button press would act as a play/pause command in my app. If the phone
is ringing or a call is in progress, I'd like to be sensitive to that
and let the button do what it normally does: pickup and hang up
calls.  we've been trying to chase the button down using this:

IntentFilter headsetFilter = new IntentFilter
(Intent.ACTION_HEADSET_PLUG);
headsetFilter.addAction
("android.intent.action.HEADSET_STATE_CHANGED");
headsetFilter.addAction("android.bluetooth.intent.HEADSET_STATE");
headsetFilter.addAction
("android.bluetooth.intent.HEADSET_STATE_CHANGED");
headsetFilter.addAction
("android.bluetooth.intent.action.MODE_CHANGED");
headsetFilter.addAction("android.intent.action.MODE_CHANGED");

no luck as of yet.  Any help would be greatly appreciated!  Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
deepdroid@googlemail.com  
View profile  
 More options Jan 31 2009, 5:07 am
From: "deepdr...@googlemail.com" <deepdr...@googlemail.com>
Date: Sat, 31 Jan 2009 02:07:10 -0800 (PST)
Local: Sat, Jan 31 2009 5:07 am
Subject: Re: headset button
you may want to look at

http://groups.google.com/group/android-developers/browse_thread/threa...

On Jan 30, 8:20 pm, Brodsky <peter.brod...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Pelly  
View profile  
 More options Feb 1 2009, 4:01 am
From: Nick Pelly <npe...@google.com>
Date: Sun, 1 Feb 2009 01:01:20 -0800
Local: Sun, Feb 1 2009 4:01 am
Subject: Re: [android-developers] Re: headset button

For wired headsets, you can use Intent.ACTION_MEDIA_BUTTON as mentioned in
the other thread. This is how the built in media app does pause/play on
wired headset button presses, and where I recommend that you hook in.

For Bluetooth headsets, they do not work like you think. There is no 'button
pressed event' sent by the headset. We don't know when the button is
pressed. Instead the headset maps its buttons presses to commands depending
on its state machine. We receive commands, not button presses from the
headset.

Nick

On Sat, Jan 31, 2009 at 2:07 AM, deepdr...@googlemail.com <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Porting beginner  
View profile  
 More options Feb 18 2010, 3:05 am
From: Porting beginner <porting.begin...@gmail.com>
Date: Thu, 18 Feb 2010 00:05:20 -0800
Local: Thurs, Feb 18 2010 3:05 am
Subject: Re: [android-developers] Re: headset button

On Sun, Feb 1, 2009 at 1:01 AM, Nick Pelly <npe...@google.com> wrote:
> For wired headsets, you can use Intent.ACTION_MEDIA_BUTTON as mentioned in
> the other thread. This is how the built in media app does pause/play on
> wired headset button presses, and where I recommend that you hook in.

> For Bluetooth headsets, they do not work like you think. There is no
> 'button pressed event' sent by the headset. We don't know when the button is
> pressed. Instead the headset maps its buttons presses to commands depending
> on its state machine. We receive commands, not button presses from the
> headset.

> Nick

> Hi,

Can you please write in some more details relate to headset button mapping ?
I got stuck here, I don't know how to go ahead. I am trying to find out
where I should hook my headset button press event ?

--
Thanks

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Porting beginner  
View profile  
 More options Feb 20 2010, 1:05 am
From: Porting beginner <porting.begin...@gmail.com>
Date: Fri, 19 Feb 2010 22:05:52 -0800
Local: Sat, Feb 20 2010 1:05 am
Subject: Re: [android-developers] Re: headset button

On Sun, Feb 1, 2009 at 1:01 AM, Nick Pelly <npe...@google.com> wrote:
> For wired headsets, you can use Intent.ACTION_MEDIA_BUTTON as mentioned in
> the other thread. This is how the built in media app does pause/play on
> wired headset button presses, and where I recommend that you hook in.

> For Bluetooth headsets, they do not work like you think. There is no
> 'button pressed event' sent by the headset. We don't know when the button is
> pressed. Instead the headset maps its buttons presses to commands depending
> on its state machine. We receive commands, not button presses from the
> headset.

> Nick

> Hi Nick,

My headset driver maps button press to KEYCODE_CALL.

I have resolved this issue with condition check in PhoneWindowsManager.c.
Now I can use my wired headset button to either receive or end incoming
call. is this proper way to fix this issue ?

--
Thanks

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
skyhigh  
View profile  
 More options Feb 22 2010, 12:17 am
From: skyhigh <skyhigh1...@gmail.com>
Date: Sun, 21 Feb 2010 21:17:38 -0800 (PST)
Local: Mon, Feb 22 2010 12:17 am
Subject: Re: headset button
For a media application you need to register a broadcast receiver for
Intent.ACTION_MEDIA_BUTTON and then when the callback is called you
want to handle the following key codes:

These key codes are sent from Bluetooth devices such as headphones and
in car stereos:
KEYCODE_MEDIA_PLAY_PAUSE
KEYCODE_MEDIA_NEXT
KEYCODE_MEDIA_PREVIOUS
KEYCODE_MEDIA_FAST_FORWARD
KEYCODE_MEDIA_REWIND
KEYCODE_MEDIA_STOP

This key code is sent from the wired headset call button:
KEYCODE_HEADSETHOOK

Good luck!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pasomas  
View profile  
 More options Mar 15 2011, 5:39 pm
From: Pasomas <paso...@gmail.com>
Date: Tue, 15 Mar 2011 21:39:50 +0000 (UTC)
Local: Tues, Mar 15 2011 5:39 pm
Subject: Re: headset button
skyhigh <skyhigh1001 <at> gmail.com> writes:

Please could you post a snippet?
I am not getting any result trying to catch those
key codes...i'm working with Galaxy Tab + Samsung HM1500 Bluetooth headset

Thank you all!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »