CHECK BLUETOOTH:
public static boolean verificaBluetooth(boolean enable) { BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); boolean isEnabled = bluetoothAdapter.isEnabled(); if (enable && !isEnabled) { return bluetoothAdapter.enable(); } else if(!enable && isEnabled) { return bluetoothAdapter.disable(); } }
REQUIRED PERMISSIONS;
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission
0 Comments: