How to identify headset capabilities

I know how to determine if a headset is connected , but some headsets (for example, Samsung EHS60ANNBE) come with a PAUSE / PLAY (aka KeyEvent. KEYCODE_HEADSETHOOK ) button only , without PREV / NEXT ...

I would like to know if the headset is currently connected to the PREV / NEXT Android device (otherwise KeyEvent.KEYCODE_ MEDIA_PREVIOUS /KeyEvent.KEYCODE_ MEDIA_NEXT ) or not.

Is it possible?

+6
source share
1 answer

Are you using BroadcastReceiver? I guess you are.

from Android Dev:

public void onReceive(Context context, Intent intent) { if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { //receive the key press event KeyEvent event = (KeyEvent)intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT); //check the keypress if (KeyEvent.**** == event.getKeyCode()) { // Handle key press. } } } } 

** link with various keypress codes

0
source

All Articles