新版本的蓝牙API将阻止旧版本设备(如Android 12设备)接收通知,但旧API可以正常工作。
public void onCharacteristicChanged (BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic,
byte[] value) {
}
API 33,在 Android 13 上运行良好,在 Android 12 上不起作用。
override fun onCharacteristicChanged(gatt: BluetoothGatt,
characteristic: BluetoothGattCharacteristic
) {
}
旧版本,在 Android 13 和 12 上运行良好。
有没有办法在使用新版本API的同时,让Android 12以下的设备正常工作?