Google is committed to advancing racial equity for Black communities. See how.

AdvertisingOptions.Builder

public static final class AdvertisingOptions.Builder extends Object

Builder class for AdvertisingOptions.

Public Constructor Summary

Builder()
Create a builder using the default advertising options.
Builder(AdvertisingOptions origin)
Creates a builder, copying the provided advertising options.

Public Method Summary

AdvertisingOptions
build()
Builds an instance of AdvertisingOptions.
AdvertisingOptions.Builder
setDisruptiveUpgrade(boolean disruptiveUpgrade)
Sets the disruptive upgrade flag.
AdvertisingOptions.Builder
setLowPower(boolean lowPower)
Sets whether low power should be used, if true only low poer mediums (like BLE) will be used for advertising.
AdvertisingOptions.Builder
setStrategy(Strategy strategy)
Set the advertising strategy, the strategy used for advertising, must match the strategy used in DiscoveryOptions.

Inherited Method Summary

Public Constructors

public Builder ()

Create a builder using the default advertising options.

public Builder (AdvertisingOptions origin)

Creates a builder, copying the provided advertising options.

Public Methods

public AdvertisingOptions build ()

Builds an instance of AdvertisingOptions.

public AdvertisingOptions.Builder setDisruptiveUpgrade (boolean disruptiveUpgrade)

Sets the disruptive upgrade flag. A disruptive upgrade may disconnect the device from its primary Wi-Fi network, or otherwise modify Wi-Fi and/or BT state to optimize for faster throughput. By default, this option is true. Set this option to false if the user needs to maintain an internet connection or if the Nearby connection is expected to persist in the background.

public AdvertisingOptions.Builder setLowPower (boolean lowPower)

Sets whether low power should be used, if true only low poer mediums (like BLE) will be used for advertising. By default, this option is false.

public AdvertisingOptions.Builder setStrategy (Strategy strategy)

Set the advertising strategy, the strategy used for advertising, must match the strategy used in DiscoveryOptions.