See Also: RemoteControlClient Members
RemoteControlClient enables exposing information meant to be consumed by remote controls capable of displaying metadata, artwork and media transport control buttons.
A remote control client object is associated with a media button event receiver. This event receiver must have been previously registered with AudioManager.RegisterMediaButtonEventReceiver(Android.Content.ComponentName) before the RemoteControlClient can be registered through AudioManager.RegisterRemoteControlClient(RemoteControlClient).
Here is an example of creating a RemoteControlClient instance after registering a media button event receiver:
java Example
ComponentName myEventReceiver = new ComponentName(getPackageName(), MyRemoteControlEventReceiver.class.getName()); AudioManager myAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); myAudioManager.registerMediaButtonEventReceiver(myEventReceiver); // build the PendingIntent for the remote control client Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); mediaButtonIntent.setComponent(myEventReceiver); PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0); // create and register the remote control client RemoteControlClient myRemoteControlClient = new RemoteControlClient(mediaPendingIntent); myAudioManager.registerRemoteControlClient(myRemoteControlClient);