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