如何将 IBluetoothA2dp.aidl 接口添加到我的项目中?
我使用的是 android 版本 2.2,但在 bluetooth
子包 android.bluetooth
中找不到 android.bluetooth.IBluetoothA2dp
。 我是否必须升级到更高版本才能使用此文件。或者我还应该做什么才能实现这个接口并在我的项目中使用它?
I'm using android version 2.2 and I cant find android.bluetooth.IBluetoothA2dp
in the bluetooth
sub-package android.bluetooth
.
Do I have to upgrade to a higher version for this file to be available. Or what else should I do so I could be able to implement this interface to use it in my project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定为什么您需要
IBluetoothA2dp
而不是BluetoothA2dp
。但IBluetoothA2dp
接口是一个隐藏接口(请参阅 此处)。至少Android 3.0以下(不含)。至于
BluetoothA2dp
类,它是在 API Level 11(Honeycomb、Android 3.0)中公开引入的。它早在 API Level 3 时就首次在 Android 中引入,并标记为隐藏。然后它在 API Level 5 中发生了巨大的变化,仍然被标记为隐藏。并且仅在 API Level 11 中正式发布。您可以在早期平台上使用反射来访问该类,但这是一种棘手且不推荐的方法。
I'm not sure why you need
IBluetoothA2dp
and not theBluetoothA2dp
. But theIBluetoothA2dp
interface is a hidden interface (see here). At least up to Android 3.0 (not including).As for
BluetoothA2dp
class it was publicly introduced in API Level 11 (Honeycomb, Android 3.0). It was first introduced in Android as earlier as API Level 3 and marked as hidden. Then it was dramatically changed in API Level 5 at still was marked as hidden. And officially released only in API Level 11.You can use reflection to access that class on earlier platforms, but that's a tricky and not recommended way.