com.google.android.gms.wearable.NodeApi |
Exposes an API for to learn about local or connected Nodes.
Node events are delivered to all applications on a device.
New code should use the CapabilityApi
which allows
you to create and listen to application-specific network events.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NodeApi.GetConnectedNodesResult | Contains a list of connected nodes. | ||||||||||
NodeApi.GetLocalNodeResult | Contains the name and id that represents this device. | ||||||||||
NodeApi.NodeListener |
This interface is deprecated.
New code should use the CapabilityApi which enables
an app to advertise a capability on a node and listen for
its existence on other nodes.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
New code should use the
CapabilityApi which enables
an app to advertise a capability on a node and listen for
its existence on other nodes.
| |||||||||||
Gets a list of nodes to which this device is currently connected, either directly or
indirectly via a directly connected node.
| |||||||||||
Gets the
Node that refers to this device. | |||||||||||
This method is deprecated.
New code should use the
CapabilityApi which enables
an app to advertise a capability on a node and listen for
its existence on other nodes.
|
This method is deprecated.
New code should use the CapabilityApi
which enables
an app to advertise a capability on a node and listen for
its existence on other nodes.
Registers a listener to receive all node events. Calls to this method should be balanced
with removeListener(GoogleApiClient, NodeListener)
, to avoid leaking resources.
Listener events will be called on the main thread, or the handler specified on
client
when it was built (using setHandler(Handler)
).
Callers wishing to be notified of node events in the background should use
WearableListenerService
.
Parameters | |
---|---|
client |
GoogleApiClient
|
listener |
NodeApi.NodeListener
|
Returns | |
---|---|
PendingResult<Status> |
Gets a list of nodes to which this device is currently connected, either directly or indirectly via a directly connected node.
The returned list will not include the local node.
Parameters | |
---|---|
client |
GoogleApiClient
|
Returns | |
---|---|
PendingResult<NodeApi.GetConnectedNodesResult> |
Gets the Node
that refers to this device. The information in the returned
Node
can be passed to other devices using the MessageApi
, for example.
Parameters | |
---|---|
client |
GoogleApiClient
|
Returns | |
---|---|
PendingResult<NodeApi.GetLocalNodeResult> |
This method is deprecated.
New code should use the CapabilityApi
which enables
an app to advertise a capability on a node and listen for
its existence on other nodes.
Removes a listener which was previously added through
addListener(GoogleApiClient, NodeListener)
.
Parameters | |
---|---|
client |
GoogleApiClient
|
listener |
NodeApi.NodeListener
|
Returns | |
---|---|
PendingResult<Status> |