public interface

NodeApi

com.google.android.gms.wearable.NodeApi

Class Overview

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.

Summary

Nested Classes
interface NodeApi.GetConnectedNodesResult Contains a list of connected nodes. 
interface NodeApi.GetLocalNodeResult Contains the name and id that represents this device. 
interface 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
abstract PendingResult<Status> addListener(GoogleApiClient client, NodeApi.NodeListener listener)
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.
abstract PendingResult<NodeApi.GetConnectedNodesResult> getConnectedNodes(GoogleApiClient client)
Gets a list of nodes to which this device is currently connected, either directly or indirectly via a directly connected node.
abstract PendingResult<NodeApi.GetLocalNodeResult> getLocalNode(GoogleApiClient client)
Gets the Node that refers to this device.
abstract PendingResult<Status> removeListener(GoogleApiClient client, NodeApi.NodeListener listener)
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.

Public Methods

public abstract PendingResult<Status> addListener (GoogleApiClient client, NodeApi.NodeListener listener)

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>

public abstract PendingResult<NodeApi.GetConnectedNodesResult> getConnectedNodes (GoogleApiClient client)

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>

public abstract PendingResult<NodeApi.GetLocalNodeResult> getLocalNode (GoogleApiClient client)

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>

public abstract PendingResult<Status> removeListener (GoogleApiClient client, NodeApi.NodeListener listener)

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>