enable Bluetooth - Android Bluetooth

Android examples for Bluetooth:Turn On bluetooth

Description

enable Bluetooth

Demo Code


//package com.java2s;
import android.bluetooth.BluetoothAdapter;

public class Main {
    public static void enableBluetooth() {
        BluetoothAdapter bluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();// w w w .j  av  a  2s .  c  o  m
        if (bluetoothAdapter != null && !bluetoothAdapter.isEnabled()) {
            bluetoothAdapter.enable();
        }
    }
}

Related Tutorials