Class WearableNode
A device on the other end of the link: the watch as seen from the phone, or the phone as seen from the watch.
Apple pairs a phone with exactly one watch at a time, so there is at most one node there. Wear OS allows several watches paired to one phone, so a phone app can see more than one -- send to all of them unless you have a reason to pick.
-
Constructor Summary
ConstructorsConstructorDescriptionWearableNode(String id, String displayName, boolean nearby) Creates a node description. -
Method Summary
Modifier and TypeMethodDescriptionReturns the device name a person would recognize, suitable for showing in a UI.getId()Returns the platform's opaque identifier for this device, stable for as long as the pairing lasts.booleanisNearby()Returns true when the device is directly connected (Bluetooth or the same network) rather than merely reachable through the cloud.toString()Returns a string representation of the object.
-
Constructor Details
-
WearableNode
Creates a node description. Called by the platform ports; application code obtains nodes from
WearableConnection.getConnectedNodes().Parameters
id: the platform's opaque identifier for the devicedisplayName: the device name a person would recognizenearby: true when the device is directly connected rather than reachable over the cloud
-
-
Method Details
-
getId
Returns the platform's opaque identifier for this device, stable for as long as the pairing lasts.
Returns
the node id
-
getDisplayName
Returns the device name a person would recognize, suitable for showing in a UI.
Returns
the display name
-
isNearby
public boolean isNearby()Returns true when the device is directly connected (Bluetooth or the same network) rather than merely reachable through the cloud. Only a nearby node can receive a live message; replicated data reaches both.
Returns
true if the node is directly connected
-
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-