public final class

Strategy

extends Object
implements Parcelable
java.lang.Object
   ↳ com.google.android.gms.nearby.connection.Strategy

Class Overview

The Strategy to be used when discovering or advertising to Nearby devices. The Strategy defines

  1. the connectivity requirements for the device, and
  2. the topology constraints of the connection.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Strategy P2P_CLUSTER Peer-to-peer strategy that supports an M-to-N, or cluster-shaped, connection topology.
public static final Strategy P2P_STAR Peer-to-peer strategy that supports a 1-to-N, or star-shaped, connection topology.
Public Methods
boolean equals(Object object)
int hashCode()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Strategy P2P_CLUSTER

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.

This is the default strategy, equivalent to calling the deprecated Connections API methods with no Strategy parameter.

public static final Strategy P2P_STAR

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.

This strategy lends itself best to one device who advertises itself, and N devices who discover that advertisement, though you may still advertise and discover simultaneously if required.

Public Methods

public boolean equals (Object object)

Parameters
object Object
Returns
boolean

public int hashCode ()

Returns
int

public String toString ()

Returns
String