title: Can't detect node using the capability api
body: <p>I am having trouble with the capability api. I am trying to send a message from my android wearable to my mobile.
  I detect a capability, but no node at all.</p>
  
  <pre><code>private static final String CAPABILITY_NAME = "mobile";
  
  @Override
  public void onConnected(Bundle bundle) {
      Log.d(TAG, "CONNECTED TO API");
      setupNode();
      Wearable.CapabilityApi.addCapabilityListener(mApiClient, capabilityListener, CAPABILITY_NAME);
  }
  
  private void setupNode() {
      new Thread(new Runnable() {
          @Override
          public void run() {
              Wearable.CapabilityApi.getCapability(
                      mApiClient, CAPABILITY_NAME,
                      CapabilityApi.FILTER_REACHABLE).setResultCallback(new ResultCallback&lt;CapabilityApi.GetCapabilityResult&gt;() {
                  @Override
                  public void onResult(CapabilityApi.GetCapabilityResult result) {
                      if (result.getCapability() == null) {
                          Log.d(TAG, "we detected no capability");
                      } else {
                          Log.d(TAG, "we detected a capability");
                      }
                      updateCapability(result.getCapability());
                  }
              });
          }
      }).start();
  }
  
  private void updateCapability(CapabilityInfo capabilityInfo) {
      Set&lt;Node&gt; connectedNodes = capabilityInfo.getNodes();
      nodeId = pickBestNodeId(connectedNodes);
      Log.d(TAG, "nodeId : " + nodeId);
  
      if (nodeId != null) {
          sendMessage(MESSAGE_PATH_READY, "connectionToMobile"); //try a config message to mobile
      } else {
          //if (mobileAppIsRunning) {
              Intent intent = new Intent();
              String status = "DISCONNECTED";
              intent.putExtra("status", status);
              intent.setAction("com.orange.myapp.watch.moto360.receiveDeviceEvent");
              sendBroadcast(intent);
          //} else {
              //DO NOTHING
          //}
      }
  }
  
  private String pickBestNodeId(Set&lt;Node&gt; nodes) {
      String bestNodeId = null;
      // Find a nearby node or pick one arbitrarily
      for (Node node : nodes) {
          if (node.isNearby()) {
              return node.getId();
          }
          bestNodeId = node.getId();
      }
      Log.d(TAG, "best node id :" + bestNodeId);
      return bestNodeId;
  }
  
  CapabilityApi.CapabilityListener capabilityListener =
          new CapabilityApi.CapabilityListener() {
              @Override
              public void onCapabilityChanged(CapabilityInfo capabilityInfo) {
                  Log.d(TAG, "CAPABILITY CHANGED!");
  
                  updateCapability(capabilityInfo);
              }
          };
  </code></pre>
  
  <p>And on the mobile side, I added the following code in the wear.xml file : </p>
  
  <pre><code>&lt;resources&gt;
      &lt;string-array name="android_wear_capabilities"&gt;
          &lt;item&gt;mobile&lt;/item&gt;
      &lt;/string-array&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>And those are the logs I printed :</p>
  
  <pre><code>02-01 18:09:16.758    4907-4907/? D/WearMessageListenerService﹕ creating service
  02-01 18:09:16.811    4907-4907/? D/WearMessageListenerService﹕ mApiClient : com.google.android.gms.common.api.zzg@7ba32
  02-01 18:09:17.138    4907-4907/? D/WearMessageListenerService﹕ CONNECTED TO API
  02-01 18:09:17.182    4907-4907/? D/WearMessageListenerService﹕ we detected a capability
  02-01 18:09:17.214    4907-4907/? D/WearMessageListenerService﹕ best node id :null
  02-01 18:09:17.215    4907-4907/? D/WearMessageListenerService﹕ nodeId : null
  </code></pre>
  
  <p>To send messages from the mobile to the watch, I don't use the capability :</p>
  
  <pre><code>private void sendMessage(final String path, final String text) {
      Wearable.NodeApi.getConnectedNodes(mApiClient)
          .setResultCallback(new ResultCallback&lt;NodeApi.GetConnectedNodesResult&gt;() {
              @Override
              public void onResult(NodeApi.GetConnectedNodesResult result) {
                  for (Node node : result.getNodes()) {
                      Wearable.MessageApi.sendMessage(mApiClient, node.getId(), path, text.getBytes());
                  }
              }
          });
  }
  </code></pre>
  
  <p>And that works fine, I receive the messages on my watch.</p>