start Bluetooth - Android android.bluetooth

Android examples for android.bluetooth:Bluetooth On Off

Description

start Bluetooth

Demo Code

import android.bluetooth.BluetoothAdapter;

public class Main{


    public static void startBluetooth() {
        BluetoothAdapter bluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();/*from  www  . ja v  a2 s  . c  om*/
        if (bluetoothAdapter != null) {
            if (!bluetoothAdapter.isEnabled()) {
                bluetoothAdapter.enable();
            }
        }
    }

}

Related Tutorials