VladMorzhanov
9/23/2017 - 2:29 PM

Android getDeviceBluetoothState

Android getDeviceBluetoothState

    /**
     * This method returns state of device bluetooth;
     * possible bluetooth state values: STATE_OFF, STATE_TURNING_ON, STATE_ON, STATE_TURNING_OFF.
     *
     * @return bluetooth state
     */
    public int getDeviceBluetoothState() {
        return ((BluetoothManager) MevicsApplication
                .getAppContext()
                .getSystemService(Context.BLUETOOTH_SERVICE))
                .getAdapter()
                .getState();
    }