VladMorzhanov
9/23/2017 - 2:31 PM

Android check is bluetooth enable

Android check is bluetooth enable

    /**
     * This method checks is device bluetooth enabled and returns result of checking
     *
     * @return boolean value that represents is device bluetooth enabled right now
     */
    public boolean isBluetoothEnabled() {

        return ((BluetoothManager) MevicsApplication
                .getAppContext()
                .getSystemService(Context.BLUETOOTH_SERVICE))
                .getAdapter()
                .isEnabled();
    }