I believe you can only call getConnectedNodes once per GoogleApiClient connection. You want to cache the node ID the first time you get the result, and then use the onPeerConnected/Disconnected() callbacks to track whether the node ID is still relevant.