Android examples for android.bluetooth:Bluetooth
check Bluetooth Availability On Device
import android.bluetooth.BluetoothAdapter; import android.content.Context; import android.util.Log; import android.widget.Toast; public class Main { public static Boolean checkBluetoothAvailabilityOnDevice() { return checkBluetoothAvailabilityOnDevice(null); }/* w w w . ja v a2 s. c o m*/ public static Boolean checkBluetoothAvailabilityOnDevice(Context context) { BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter == null) { Log.e("Fatal Error", "Bluetooth not support"); } else { if (btAdapter.isEnabled()) { Log.d("checkBluetoothAvailabilityOnDevice", "...Bluetooth ON..."); return true; } else { // Prompt user to turn on Bluetooth if (context != null) { Toast toast = Toast.makeText(context, "Turn on Bluetooth", Toast.LENGTH_LONG); toast.show(); } } } return false; } }