I am developing a helper application for smart watches in Android studio, if the watch I want as a command is connected to the phone, I want it to redirect to the page that says connected, if it is not connected to the phone, I want it to redirect to the page that says connect watch, I can redirect the page with if else, but I want to write a function that detects all wear OS and Android 30+ compatible watches and controls the Bluetooth connection. I could not write
You can check the connected nodes and see if your device is on that list.
implementation("com.google.android.gms:play-services-wearable:19.0.0")
Wearable.getNodeClient(context).connectedNodes.addOnSuccessListener { nodes ->
val isWatchConnected = nodes.any {it.displayName == "YourWatchName"}
if (isWatchConnected) {
println("Watch is connected")
} else {
println("Watch is not connected")
}
}
for more info you can visit this page:
Send and receive messages on Wear | Wear OS | Android Developers
The event I want is exactly this way, how can I do this, not only my own watch, but I want it to recognize all smartwatches running wear OS and api30+.
The one I’ve shown is an example on native android. I couldn’t find any first party solution to connect WearOS devices to IOS. But you can try to detect it via bluetooth.
I don’t think Wear OS is (very) usable with iOS because Apple limits the use of the necessary APIs to its own devices.
How can I make the link that opens on the clock when I press the button in kotlin language in android studio ?
@Kerim is the button on the app or on the watchface?
When clicked in the mobile application, I want to send a request to the watch and open the link link on the watch, if the connection is broken, I want to give a connect your watch toast message and redirect to another activity
This can’t be done using Watch Face Format, which is what Watch Face Studio generates.