CHECK BLUETOOTH:

agosto 17, 2018 doido 2.0 0 Comments

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: