NodeApi | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
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.

## 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 | Used with `addListener(GoogleApiClient, NodeApi.NodeListener)` to receive node events.

Public Methods
abstract PendingResult<Status> | addListener(GoogleApiClient client, NodeApi.NodeListener listener) Registers a listener to receive all node events.
abstract PendingResult<NodeApi.GetConnectedNodesResult> | getConnectedNodes(GoogleApiClient client) Gets a list of `Node`s to which this device is currently connected.
abstract PendingResult<NodeApi.GetLocalNodeResult> | getLocalNode(GoogleApiClient client) Gets the `Node` that refers to this device.
abstract PendingResult<Status> | removeListener(GoogleApiClient client, NodeApi.NodeListener listener) Removes a listener.

## Public Methods

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

Registers a listener to receive all node events.

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

Gets a list of `Node`s to which this device is currently connected.

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

Gets the `Node` that refers to this device. The information in Node can be passed to other devices using `MessageApi`.

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

Removes a listener.