ConnectionStrategy

Nearby Connections supports different strategies for advertising and discovery. The best strategy to use depends on the use case.

Entries

Link copied to clipboard

The cluster strategy is a peer-to-peer strategy that supports an M-to-N, or cluster-shaped, connection topology. In other words, this enables connecting amorphous clusters of devices within radio range (~100m), where each device can both initiate outgoing connections to M other devices and accept incoming connections from N other devices.

Link copied to clipboard

The star strategy is a peer-to-peer strategy that supports a 1-to-N, or star-shaped, connection topology. In other words, this enables connecting devices within radio range (~100m) in a star shape, where each device can, at any given time, play the role of either a hub (where it can accept incoming connections from N other devices), or a spoke (where it can initiate an outgoing connection to a single hub), but not both.

Link copied to clipboard

The point-to-point strategy is a peer-to-peer strategy that supports a 1-to-1 connection topology. In other words, this enables connecting devices within radio range (~100m) with the highest possible throughput, but does not allow for more than a single connection at a time.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.