ConnectionOptions.Builder

public static final classConnectionOptions.BuilderextendsObject

Builder class for ConnectionOptions.

Public Constructor Summary

Public Method Summary

ConnectionOptions
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

publicBuilder()

publicBuilder(ConnectionOptions origin)

Public Methods

publicConnectionOptions build()

public ConnectionOptions.BuildersetConnectionType(int connectionType)

Sets whether the client should disrupt the current connection to optimize the transfer or not. The default is ConnectionType.BALANCED.

public ConnectionOptions.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 ConnectionOptions.BuildersetLowPower(boolean lowPower)

Sets whether to attempt to connect with the lowest possible power (like BLE) if true. By default, this option is false.