start Bluetooth - Android Bluetooth

Android examples for Bluetooth:Turn off bluetooth

Description

start Bluetooth

Demo Code


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

public class Main {
    public static void startBluetooth() {
        BluetoothAdapter bluetoothAdapter = BluetoothAdapter
                .getDefaultAdapter();//w ww.  ja v a 2  s.c  om
        if (bluetoothAdapter != null) {
            if (!bluetoothAdapter.isEnabled()) {
                bluetoothAdapter.enable();
            }
        }
    }
}

Related Tutorials