0

I want to check the connection status between android wear and mobile. I know the WearableListenerService service methods onPeerConnected and onPeerDisconected. They are callback methods. I want to check the connection status on the click of a button. How can I do this?

user3921255
  • 41
  • 1
  • 2
  • 5
  • possible duplicate of [How to detect if android device is paired with android wear watch](http://stackoverflow.com/questions/24877170/how-to-detect-if-android-device-is-paired-with-android-wear-watch) – hcpl Jan 23 '15 at 07:09
  • Check this answer I wrote: http://stackoverflow.com/a/39513489/878126 – android developer Sep 16 '16 at 18:33

1 Answers1

1

Wearable.NodeApi.getConnectedNodes returns a list of Nodes representing either the connected handheld (if called from the Wear app) or connected Wear devices (if called on the handheld). The list should be empty if there is no connection. Google has a short example here.

eshayne
  • 915
  • 9
  • 15