Best practice for AVRCP on Android (sending meta-data to bluetooth device)

早过忘川 提交于 2019-12-21 16:55:04

问题


I want to send meta-data to a bluetooth device, via an Android 4.3+ device.

The solution that I came across, and that works, is sending an intent to google.android.music (the google music app), informing it about the meta-data, as seen here: send track informations via A2DP/AVRCP. I might be wrong, but this does not seem to be the way AVRCP should work on android.

As far as I understood, the best practice would be to use RemoteControlClient.MetadaDataEditor like so:

        mRemoteControlClient.editMetadata(true)
                .putString(MediaMetadataRetriever.METADATA_KEY_ARTIST, playingItem.getArtist())

This is actually advised by google themselves as the best practice: http://youtu.be/EC5-cEbr520?t=25m18s

The problem is that I cannot make my app to send meta-data to the bluetooth device with the advised RemoteControlClient.MetadaDataEditor class, but using the intent to the google music app it works.

Does anybody know why this happens? What is the most correct way to send meta-data to the bluetooth device? Thanks!


回答1:


The solution is to use METADATA_KEY_ALBUMARTIST instead.



来源:https://stackoverflow.com/questions/21246028/best-practice-for-avrcp-on-android-sending-meta-data-to-bluetooth-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!