Example usage for android.bluetooth BluetoothAdapter isMultipleAdvertisementSupported

List of usage examples for android.bluetooth BluetoothAdapter isMultipleAdvertisementSupported

Introduction

In this page you can find the example usage for android.bluetooth BluetoothAdapter isMultipleAdvertisementSupported.

Prototype

public boolean isMultipleAdvertisementSupported() 

Source Link

Document

Return true if the multi advertisement is supported by the chipset

Usage

From source file:Main.java

public static boolean btlePeripheralSupport(BluetoothAdapter bluetoothAdapter) {
    if (bluetoothAdapter == null) {
        return false;
    }//from www.  j av  a2s. com
    try {
        return bluetoothAdapter.isMultipleAdvertisementSupported();
    } catch (NoSuchMethodError e) {
        return false;
    }
}

From source file:Main.java

/**
 * Check if Bluetooth LE Peripheral mode supported on the running environment.
 *
 * @param context the context/*from w w  w  .j  a v a  2  s.c om*/
 * @return true if supported
 */
@SuppressLint("NewApi")
public static boolean isBlePeripheralSupported(@NonNull Context context) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        return false;
    }

    final BluetoothAdapter bluetoothAdapter = ((BluetoothManager) context
            .getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter();

    if (bluetoothAdapter == null) {
        return false;
    }

    return bluetoothAdapter.isMultipleAdvertisementSupported();
}

From source file:com.coinblesk.client.utils.UIUtils.java

private static boolean hasBluetoothLEAdvertiser(Context context) {
    BluetoothManager bm = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
    BluetoothAdapter mBluetoothAdapter = bm.getAdapter();
    return mBluetoothAdapter != null && mBluetoothAdapter.isMultipleAdvertisementSupported();
}