Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Background: I have a A2DP/AVRCP bluetooth headset (Nokia BH-505) which I use actively to listen to both podcasts and music. Of course, I listen to these with different apps. The bluetooth headset has some "command" (AVRCP) buttons, relevant to audio - in specific: "next track", "previous track" and "play/pause"

Currently whenever I press any of the commands, one of the music players I have installed (Meridian) always gets the command - even when it's not active. So when I click "play/pause" intending to pause a podcast (DoggCatcher), instead Meridian is activated and starts playing music along with the podcast.

Both players are set to be using the headset: DoggCatcher has "Bind to headset" turned on, and Meridian has "Headset Buttons" turned on. I'm currently using unrooted stock Android 2.2.1 on GT-S5570 but may be rooting and upgrading to 2.3 CyanogenMod (or such), in future.

Ignoring the specifics, my question about this is more general:

  • How does Android determine which app gets to react to these commands? I'm interested even in a very techincal answer.

On the practical side I'm interested in:

  • Do I have to fiddle with each applications settings to determine which application takes the commands, or is there some general way of determining this?
  • Is there a way to configure this so that the application that's actually active would automatically always get the priority? (as was asked partly in another question)

How this question differs from similar questions:

share|improve this question
I did manage to find some good information related to this from an Android developer blog - discussing the proper way that this should be implemented by applications in 2.2: "Allowing applications to play nice(r) with each other: Handling remote control buttons" – Ilari Kajaste Sep 21 '11 at 6:40
up vote 7 down vote accepted

media-button-router, already mentioned in one of your linked questions, tries to figure out what app is currently playing music and to dispatch the AVRCP events to it. In addition, it lists all apps installed, that declare to listen to AVRCP events.

What makes AVRCP complicated: Some apps, like Sony's Music Unlimited, seem not to declare android.intent.action.MEDIA_BUTTON in their manifest. For this (or maybe some other) reason they can't be controlled via media-button-router. I know that e.g. Music Unlimited can be controlled via AVRCP since I read it in a user comment and also I was able to get it running once but unfortunately it's not reproducable. So in those cases it seems that we have to wait for an app's update with a clean implementation of AVRCP event handling.

According to media-button-router's wiki "Media Button Intent handling is done through ordered broadcasts, and each app sets it's own priority for receiving." So maybe it could be possible to write an app that displays theese priorities and, in effect, would allow you to determine what application will start. However, I don't know about such an app.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.