对于AVRCP在Android的最佳实践(发送元数据到蓝牙设备) [英] Best practice for AVRCP on Android (sending meta-data to bluetooth device)

查看:1779
本文介绍了对于AVRCP在Android的最佳实践(发送元数据到蓝牙设备)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要的元数据发送到蓝牙设备,通过一个Android 4.3+设备。

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

这是我碰到的解决方案,并且工作,正在发送意图google.android.music(谷歌的音乐应用程序),通知它有关的元数据,因为在这里看到:的 //stackoverflow.com/questions/15527614/send-track-informations-via-a2dp-avrcp">send跟踪信息。我可能是错的,但是这似乎并没有被AVRCP应该工作在Android上的方式。

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.

据我的理解,最好的做法是使用 RemoteControlClient .MetadaDataEditor 的像这样:

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())

这实际上是由谷歌劝自己是最好的做法: http://youtu.be/ EC5-cEbr520?吨= ​​25m18s

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

现在的问题是,我不能让我的应用程序的元数据发送到蓝牙设备与建议RemoteControlClient.MetadaDataEditor类,但使用的意图,谷歌的音乐应用程序,它的工作原理。

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!

推荐答案

该解决方案是使用METADATA_KEY_ALBUMARTIST代替。

The solution is to use METADATA_KEY_ALBUMARTIST instead.

这篇关于对于AVRCP在Android的最佳实践(发送元数据到蓝牙设备)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆