Bluetooth 如何在android中检测BT耳机

Bluetooth 如何在android中检测BT耳机,bluetooth,Bluetooth,我从这里引用代码 他们提到,只有Android 3.0及以上版本支持BluetoothHeadset和BluetoothProfile类 那么,我们如何使用或不使用该类来检测BT耳机呢?您可以使用该类来检测耳机,特别是getBluetoothClass(),该类返回一个对象。然后可以调用getDeviceClass(),并将其与中定义的常量进行比较 这些问题从API级别5(Android 2.0)开始提供。如中所述,开发问题在这里是离题的。我投票决定将其转移到Stack Overflow,它处理

我从这里引用代码

他们提到,只有Android 3.0及以上版本支持
BluetoothHeadset
BluetoothProfile


那么,我们如何使用或不使用该类来检测BT耳机呢?

您可以使用该类来检测耳机,特别是
getBluetoothClass()
,该类返回一个对象。然后可以调用
getDeviceClass()
,并将其与中定义的常量进行比较


这些问题从API级别5(Android 2.0)开始提供。

如中所述,开发问题在这里是离题的。我投票决定将其转移到Stack Overflow,它处理软件开发。