Exposes an API for learning about local or connected Nodes.
Node events are delivered to all applications on a device.
New code should use CapabilityClient
which allows you to create and listen to application-specific network events.
Nested Class Summary
interface | NodeClient.OnNodeMigratedListener | Receives events after a node migration has successfully finished. |
Constant Summary
String | ACTION_NODE_MIGRATED | Node migration action for use in manifest-based listener filters. |
Public Method Summary
abstract Task<String> |
getCompanionPackageForNode(String watchNodeId)
Gets the package name for the Companion application associated with this node.
|
abstract Task<List<Node>> |
getConnectedNodes()
Gets a list of nodes to which this device is currently connected, either
directly or indirectly via a directly connected node.
|
abstract Task<Node> |
getLocalNode()
Gets the
Node
that refers to this device.
|
abstract Task<String> |
Inherited Method Summary
Constants
public static final String ACTION_NODE_MIGRATED
Node migration action for use in manifest-based listener filters.
Public Methods
public abstract Task<String> getCompanionPackageForNode (String watchNodeId)
Gets the package name for the Companion application associated with this node.
Parameters
watchNodeId | must be a valid nodeId corresponding to a connected watch |
---|
Returns
- a Companion application package name; returns an empty string instead if none are associated, or if the specified watch is not currently connected
public abstract Task<List<Node>> getConnectedNodes ()
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
.
public abstract Task<Node> getLocalNode ()
Gets the Node
that
refers to this device. The information in the returned Node
can be
passed to other devices using MessageClient
,
for example.