How to control the default music player of android or any other player? By controlling i mean pause, play, next etc. Do i have to bind the service? I have tried to use the <
If you want to control the music player (the current playing one) there is a way to send KeyEvents to it:
if (mAudioManager == null) mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_MEDIA_PLAY);
mAudioManager.dispatchMediaKeyEvent(event);
This is a safer way, cause usually broadcasting keyEvent could cause to play more than one player at a time.
Note: it needs to have minSdk 19 or more.