turn on Bluetooth - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth On Off

Description

turn on Bluetooth

Demo Code

import android.bluetooth.BluetoothAdapter;
import android.util.Log;

public class Main {

  public static void onBluetooth() {
    BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    if (!bluetoothAdapter.isEnabled()) {
      bluetoothAdapter.enable();// w  w  w . j av  a 2 s  .  c  om
      Log.i("Log", "Bluetooth is Enabled");
    }
  }

}

Related Tutorials