Builder class for ConnectionOptions.
Public Constructor Summary
Builder()
|
|
Builder(ConnectionOptions
origin)
|
Public Method Summary
ConnectionOptions |
build()
|
ConnectionOptions.Builder |
setConnectionType(int connectionType)
Sets whether the client should disrupt the current connection to optimize the
transfer or not.
|
ConnectionOptions.Builder |
setDisruptiveUpgrade(boolean disruptiveUpgrade)
This method is deprecated. Use
setConnectionType(int) instead.
|
ConnectionOptions.Builder |
setLowPower(boolean lowPower)
Sets whether to attempt to connect with the lowest possible power (like BLE) if
true.
|
Inherited Method Summary
Public Constructors
public Builder ()
public Builder (ConnectionOptions origin)
Public Methods
public ConnectionOptions build ()
public ConnectionOptions.Builder setConnectionType (int connectionType)
Sets whether the client should disrupt the current connection to optimize the
transfer or not. The default is
ConnectionType.BALANCED
.
public ConnectionOptions.Builder setDisruptiveUpgrade (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 ConnectionOptions.Builder setLowPower (boolean lowPower)
Sets whether to attempt to connect with the lowest possible power (like BLE) if true. By default, this option is false.