简体   繁体   中英

Check android wear and mobile connection status

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM