Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3804334
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:30:07+00:00 2026-05-19T14:30:07+00:00

All, I have searched for an answer to this, but I’m not getting anything

  • 0

All,

I have searched for an answer to this, but I’m not getting anything exact… It’s my first time writing an Android app, so please be gentle 🙂

I’m pretty bummed about the minimal headset support in Android – unlike e.g. iPhone, it only natively seems to support a single button, so no volume control on headset compatibility. Additionally, if I’m listening to music and a call comes in, the OS pauses the music automatically, but the headset button still functions ONLY as a media button – I can’t use it to answer/end the call. If I answer the call via the screen and press the headset button, the music starts again, but the call continues…

I’d like to create a ‘middleman’ app that can pick up that the headset button has been pressed (via Keyevent.KEYCODE_HEADSETHOOK) and can then determine whether to perform the default ACTION_MEDIA_BUTTON action (toggle play/pause in my chosen media player) or, if there is an incoming call, pause the music and answer the phone (and then, when pressed again, end the call and restart the media player). Perhaps even check for ACTION_MULTIPLE on the headset button to assign different options (ACTION_MEDIA_NEXT, ACTION_MEDIA_PREVIOUS etc.). Perhaps also be able to determine whether different buttons on the headset have been pressed (if the headset is e.g. a fancy iPhone headset) and ‘translate’ those button presses into the appropriate ACTION_MEDIA_*). This might not be possible if the OS can’t tell the difference between different buttons, obviously.

Obviously such an app would have to receive the intent with a high enough priority that it would be able to abort the broadcast before the current media player gets it.

I’ve been tinkering with creating assorted BroadcastReceiver classes and intent filters etc., but part of the problem is that the bult-in Android emulator that comes with Eclipse doesn’t seem to have the ability to simulate a user plugging in the headset and/or subsequently clicking the headset button. Therefore, every time I get somethign that looks promising, I have to put it onto my actual phone and try it out – time-consuming and a hassle.

3 questions then:

  1. Am I missing somethign obvious – is this a real problem and if so, has it already been solved?

  2. If it IS a problem, is it possible to write such a middleman app?

  3. Are there any other Android emulators that can check for headset-related activities?

Thanks,

Rory

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T14:30:08+00:00Added an answer on May 19, 2026 at 2:30 pm

    i´ve already written exactly this kind of app. Its called like the topic of this thead: Headset Button Controller 😉

    http://www.androidpit.com/en/android/market/apps/app/com.kober.headset/Headset-Button-Controller

    Cheers Christoph

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all I have searched many times in this forum but none is
I have searched for topics specifically to this question but have not found anything
I have searched for this answer, but unable to find it. I am getting
I have searched the site for this simple problem but cant find an answer.
Okay, this should be really simple, but I have searched all over for the
I have searched this web looking for an answer, but it seems that this
I've searched for this but can't seem to find the exact answer. I want
I have searched (probed ,even) for an answer to this but haven't come up
I have searched the site, but can not find the answer or how it
I have searched all the questions related to this topic but i didnt find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.