https://kotlinlang.org logo
#compose-wear
Title
# compose-wear
l

lam bui

10/19/2023, 7:01 AM
Hello, Can I wake up wear from the app? Currently I can do it on iOS, but on Android I haven’t found any documentation about this? I want to start workout from the app, and it wake up wear and start record exercise with hearth, burn calories... Thank you.
g

Garan Jenkin

10/19/2023, 9:07 AM
Do you mean wake up / launch Wear app from the phone app? If so, yes - see https://developer.android.com/reference/androidx/wear/remote/interactions/RemoteActivityHelper and also WearableListenerService: https://developers.google.com/android/reference/com/google/android/gms/wearable/WearableListenerService Also worth looking at Horologist, which has some capability for supporting this type of behaviour: https://google.github.io/horologist/datalayer-helpers-guide/
l

lam bui

10/19/2023, 4:51 PM
thank you, i want start workout from app on mobile, then app on wear will wake up and start workout( to log distance, hearth, calories)
m

Mark Murphy

10/19/2023, 5:02 PM
Send a message from the phone app to the watch app. Note: this is unrelated to Compose or Wear Compose.
l

lam bui

10/19/2023, 5:18 PM
i got it, thank you.
i want, receive action from app: then: navigation to screen on wear. Current use navigation compose wear: https://developer.android.com/training/wearables/compose/navigation I am having an issue, when receiving data from activity, then start root each screen in navigation?
g

Garan Jenkin

10/20/2023, 1:23 PM
You can use deeplinks as one solution to navigate directly to a particular screen: https://developer.android.com/jetpack/compose/navigation#deeplinks
See also https://developer.android.com/training/app-links/deep-linking as you might not want a generic web intent e.g. https://myapp/... but instead an app intent myapp://.../ as the former come with more setup restrictions (see the note on that link, "...a generic web intent resolves to an activity in your app only if your app is approved for the specific domain contained in that web intent ..."
❤️ 1
👍 1
l

lam bui

10/20/2023, 2:59 PM
thank you for your support.
@Garan Jenkin: onDataChange when emit 2 item same: 1. “event”“REST”,“title”“Squats” 2. “event”“REST”,“title”“Squats” not emit. But when trigger: 1. “event”“REST”,“title”“Squats” 2. “event”“COMPLETE”,“title”“Squats” 3. “event”“REST”,“title”“Squats”
Besides WearableListenerService, are there other methods to emit data between wear app and smart phone?
2 Views