Builder class for AdvertisingOptions.
Public Constructor Summary
Builder()
Creates a builder using the default advertising options.
|
|
Public Method Summary
AdvertisingOptions |
build()
|
AdvertisingOptions.Builder |
setConnectionType(int connectionType)
Sets whether the client should disrupt the current connection to optimize the
transfer or not.
|
AdvertisingOptions.Builder |
setDisruptiveUpgrade(boolean disruptiveUpgrade)
This method is deprecated. Use
setConnectionType(int) instead.
|
AdvertisingOptions.Builder |
setLowPower(boolean lowPower)
Sets whether low power should be used.
|
AdvertisingOptions.Builder |
Inherited Method Summary
Public Constructors
publicBuilder()
Creates a builder using the default advertising options.
publicBuilder(AdvertisingOptions origin)
Creates a builder, copying the provided advertising options.
Public Methods
publicAdvertisingOptions build()
public AdvertisingOptions.BuildersetConnectionType(int connectionType)
Sets whether the client should disrupt the current connection to optimize the
transfer or not. The default is
ConnectionType.BALANCED
.
public AdvertisingOptions.BuildersetDisruptiveUpgrade(boolean disruptiveUpgrade)
This method is deprecated.
Use
setConnectionType(int)
instead.
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.BuildersetLowPower(boolean lowPower)
Sets whether low power should be used. If true, only low power mediums (like BLE) will be used for advertising. By default, this option is false.
public AdvertisingOptions.BuildersetStrategy(Strategy strategy)
Sets the advertising strategy. The strategy used for advertising must match the
strategy used inDiscoveryOptions
.