Android examples for Bluetooth:Bluetooth State
get Bluetooth State
//package com.java2s; import android.bluetooth.BluetoothAdapter; public class Main { public static int getBluetoothState() throws Exception { BluetoothAdapter bluetoothAdapter = BluetoothAdapter .getDefaultAdapter();/*from w ww . j a va 2 s .c o m*/ if (bluetoothAdapter == null) { throw new Exception("bluetooth device not found!"); } else { return bluetoothAdapter.getState(); } } }