app/src/main/java/com/shoaibsaikat/ble/ClientActivity.java
//Check if bluetooth is enabled, if not, then request enable
Check if bluetooth is enabled, if not, then request enable
Check if bluetooth is enabled if not then request enable
private void enableBluetooth() {
        if (mBluetoothAdapter == null) {
            Log.e(BluetoothUtility.TAG, "Bluetooth NOT supported");
        } else if (!mBluetoothAdapter.isEnabled()) {
            Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(enableBtIntent, 1);
        }
    }
private void enableBluetooth ( ) { if ( mBluetoothAdapter == null ) { Log . e ( BluetoothUtility . TAG , "Bluetooth NOT supported" ) ; } else if ( ! mBluetoothAdapter . isEnabled ( ) ) { Intent enableBtIntent = new Intent ( BluetoothAdapter . ACTION_REQUEST_ENABLE ) ; startActivityForResult ( enableBtIntent , 1 ) ; } }
Check if bluetooth is enabled, if not, then request enable
Check if bluetooth is enabled if not then request enable