(3.0 之前的)Android 程序可以连接到蓝牙 A2DP 设备吗?
使用gingerbread/froyo/eclair(例如2.1、2.2、2.3 -> 不是蜂窝)编写的程序可以连接到A2DP 蓝牙接收器设备吗?或者,我是否需要让用户转到他们的设置才能执行此操作?任何帮助或建议将不胜感激。
Can a program that is written using the gingerbread/froyo/eclair (e.g. 2.1, 2.2, 2.3 -> NOT honeycomb) connect to a A2DP bluetooth sink device?? Or, do I need to have the user go to their settings to do so? Any help or advice would be highly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
因此,经过更多研究,似乎不可能在 3.0 之前的 Android 设备上以编程方式连接到 A2DP 设备。我将将此标记为答案,但如果有人发现其他问题,请纠正我,因为我真的很想以编程方式完成此操作。
So, after much more research, it seems that it is impossible to programmatically connect to a A2DP device on a pre-3.0 Android device. I am going mark this as the answer but, if someone finds otherwise, please correct me on this as I would really like to do it programmatically.
你不能使用BluetoothA2dp::connectSink()吗?创建一个 BluetoothA2dp 实例,然后使用您尝试连接的设备调用 connectSink(BluetoothDevice device) 。
代码:
http://www.google.com/codesearch#uX1GffpyOZk/core/java/android/bluetooth/BluetoothA2dp.java&q=BluetoothA2dp&l=112
看来这个API不是不过,BluetoothA2dp 的 Android API 参考中列出了:
http://developer.android.com/reference/android/bluetooth/BluetoothA2dp.html
Can't you use BluetoothA2dp::connectSink()? Create a BluetoothA2dp instance, then call connectSink(BluetoothDevice device) with the device you're trying to connect to.
code:
http://www.google.com/codesearch#uX1GffpyOZk/core/java/android/bluetooth/BluetoothA2dp.java&q=BluetoothA2dp&l=112
It seems like this API is not listed in the Android API reference for BluetoothA2dp though:
http://developer.android.com/reference/android/bluetooth/BluetoothA2dp.html
因此,经过更多研究,我发现并验证实际上可以使用隐藏的 API 通过蓝牙连接到 a2dp 设备。然而,似乎在蜂窝后,这种方法不再可能了......我将就此发布另一个问题。
So, after much more research, I found and verified that it is actually possible to use the hidden API's to connect to a a2dp device via bluetooth. However, it seems that post-honeycomb, that method isn't possible anymore... I will post another question regarding that.