|
Posted at 4/5/2015 10:57:33
1#
This version does not support Bluetooth Advertize.
Do support the future?
test code:
final BluetoothManager manager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
final BluetoothAdapter bluetoothAdapter = manager.getAdapter();
// check Bluetooth support
final boolean isBluetoothSupported = bluetoothAdapter != null;
if (!isBluetoothSupported) {
return;
}
// check Bluetooth setting is ON
if (!bluetoothAdapter.isEnabled()) {
return;
}
// check Bluetooth Advertise support
BluetoothLeAdvertiser mBluetoothLeAdvertiser = bluetoothAdapter.getBluetoothLeAdvertiser();
final boolean isAdvertiseSupported = mBluetoothLeAdvertiser != null;
if (!isAdvertiseSupported){
return; // !!!!!!
}
|
|