2

I was trying to find the list of Nodes via getNodes() method in NodeAPI in GooglePlayServices.

I have one LG G Live watch, one Samsung Gear 2 (Tizen OS) and one Google Glass.

My LG G Watch has a connection with a companion APP (via GoogleAPIClient) on phone (Samsung S4). I have one application which checks if the watch is connected with phone, and if not connected, notify user about the same. I was using getNodes() method for this, and I connected glass and gear with phone with "My Glass" and "Gear Manager" (that's it). I was under the impression that both glass and gear would also get shown in getNodes() list, but only G Live came in the list.

So, now, I think that device must be connected with GoogleApiClient with phone (via a companion App), in order to show it as a node. That thing said, what if I am connecting Glass/Tizen with phone via GoogleApiClient but in other separate companion App on phone. Would it then show it as a node? Which brings me to the initial question, how do we define nodes in Google Play Services? and If it'll show them as nodes, how would I detect if it is a watch or glass or gear ( I can register devices for this issue, but I want to avoid that), I tried getDisplayName() and getId(), but both return same thing i.e. UUID of the node.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Neeraj Kumar
  • 226
  • 4
  • 18

2 Answers2

1

The Tizen device is not Android. Therefore, you will not be able to use the NodeAPI library with it. For how nodes are defined on an Android Wear device, you need to connect a GoogleApiClient and add a wearable listener in the following manner: Wearable.MessageApi.addListener(<GoogleApiClient name>, this);

Unfortunately, Glass does not support Google Play Services. You can follow this post for the latest on this topic.

Koh
  • 1,570
  • 1
  • 8
  • 6
  • Thanks for your reply, by the way, i'd already figured it out. Its unfortunate that glass doesn't support Google Play Services, it would have been really easy to build glass, phone apps. I am currently working on these and wanted to avoid any socket programming to transfer app data. Do you know any API suitable for the task? – Neeraj Kumar Dec 30 '14 at 06:36
1

Sorry to tell you man but google play services dont work for glass, but as I read your question i think you want to check if your glass/ watch is connected to the mobile or not, try to make bluetooth connection via socket for glass and unique ID would come. While for watch go ahead with play services.

I hope it helps.

  • Thanks @Bhatt, i wanted to avoid any socket programming. Currently, i am using glass and phone app, and i need to transfer app data like strings etc, but i want to avoid any socket programming. Is there any API available to work it out, or do you have any other suggestions ? – Neeraj Kumar Dec 30 '14 at 06:41