Example usage for android.bluetooth.le AdvertiseSettings ADVERTISE_MODE_LOW_POWER

List of usage examples for android.bluetooth.le AdvertiseSettings ADVERTISE_MODE_LOW_POWER

Introduction

In this page you can find the example usage for android.bluetooth.le AdvertiseSettings ADVERTISE_MODE_LOW_POWER.

Prototype

int ADVERTISE_MODE_LOW_POWER

To view the source code for android.bluetooth.le AdvertiseSettings ADVERTISE_MODE_LOW_POWER.

Click Source Link

Document

Perform Bluetooth LE advertising in low power mode.

Usage

From source file:Main.java

@TargetApi(21)
public static AdvertiseSettings getAdvertiseSettings(boolean connectable) {
    AdvertiseSettings.Builder builder = new AdvertiseSettings.Builder();
    builder.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_POWER);
    builder.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_MEDIUM);
    builder.setConnectable(connectable);

    return builder.build();
}