1

我使用的是 android 2.2 版android.bluetooth.IBluetoothA2dp,在bluetooth子包中找不到android.bluetooth。我是否必须升级到更高版本才能使用此文件。或者我还应该怎么做才能实现这个接口以在我的项目中使用它?

4

1 回答 1

1

我不确定你为什么需要IBluetoothA2dp而不是BluetoothA2dp. 但是IBluetoothA2dp界面是隐藏界面(见这里)。至少到 Android 3.0(不包括)。

至于BluetoothA2dp类,它是在 API Level 11(Honeycomb,Android 3.0)中公开引入的。它早在 API 级别 3 就首次在 Android 中引入,并标记为隐藏。然后它在 API 级别 5 中发生了巨大变化,仍然被标记为隐藏。并且仅在 API Level 11 中正式发布。

您可以使用反射在早期平台上访问该类,但这是一种棘手且不推荐的方式。

于 2011-06-17T06:59:32.047 回答