Android Question RemoteControlClient / RemoteControlClient.editMedtadata

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Can someone explain how I can do the following?

I believe I need to do this:
B4X:
// create and register the remote control client
RemoteControlClient myRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
myAudioManager.registerRemoteControlClient(myRemoteControlClient)
http://developer.android.com/reference/android/media/RemoteControlClient.html
http://developer.android.com/reference/android/media/RemoteControlClient.MetadataEditor.html

So I can do the following:

B4X:
IRemoteControlClient.MetadataEditor ed = mRemoteControlClient.editMetadata(true);
ed.putString(MediaMetadataRetriever.METADATA_KEY_TITLE, title);
ed.putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, album);
ed.putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, artist);
ed.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, track.getDuration());
ed.apply();
http://stackoverflow.com/questions/15527614/send-track-informations-via-a2dp-avrcp

It seems what I use to do:

B4X:
      Dim NewIntent  As Intent
       
         NewIntent.Initialize("com.android.music.metachanged", "")
   
         NewIntent.PutExtra("id"  , sMusicDB_PlayingMP3Info.RecordID)     
       NewIntent.PutExtra("track"  , sMusicDB_PlayingMP3Info.Title)     
         NewIntent.PutExtra("artist"  sMusicDB_PlayingMP3Info.Artist)     
       NewIntent.PutExtra("album"  , sMusicDB_PlayingMP3Info.Album)
     
       NewIntent.PutExtra("playing"  , IsPlaying)       
         
       If  IsPlaying Then
           NewIntent.PutExtra("playerState" , 3)
         Else
         NewIntent.PutExtra("playerState" , 2)               
         End If
     
         NewIntent.PutExtra("sMediaKeys", True)
     
       Dim sMusicDB_Phone As Phone
     
       sMusicDB_Phone.SendBroadcastIntent(NewIntent)

Is NOT supported in Android 4.4.2 both works fine on Android 4.1.2

Just so lost...

Any Help Appreciated?

BobVal
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…