Impossible to send data from wearOs app to phone app (kotin) with Data

Hello everyone, I am facing a full-blown deadlock right now. Even specialized coding AI won’t get me through. By the way: total beginner here, it is my first app.

I am using the latest version of Android Studio. I own a Samsung Galaxy Watch 6 classic and a Samsung S24 ultra (both fully up to date firmware-wise). I coded in Kotlin a WearOs app for ice skaters. It records several data during the session, like the session date, duration, average and max speed, skated distance, heart rate, calories burnt etc. I also coded, in the same project, the companion phone app (a second module) that is supposed to receive the data. On the phone app, I click on “free skating session”, and the date of the session is supposed to show up, click on the date and display the other values in a lazy column.

The problem is, I can’t get the data to be sent to the phone app. On my watch app, I am using a ViewModel that retrieves and updates the values. When the session is done, the data are “parcelized” (I have the data class SessionData on a third module named common, it is shared between the watch and phone app) and I use putDataMapRequest to send them:

Wearable.getDataClient(context).putDataItem(putDataRequest).await()

The path is “/session-data”, the same in the watch and phone app.

Then I have my listener on the phone app with the OnDatachanged function. It is supposed to retrieve the data and deparcelize them. But the OnDataChanged never fires…

I added helping toasts to have an idea where this fails. When the session is done, the watch toast says “data queued for transfer”. So it looks like the watch thinks the job is correctly done. I also implemented toasts on the phone but they never show. Just a blank page instead of the skating session date.

In an 10 y.o. topic, they recommended that the phone and the watch must have the same application ID. ChatGPT o1 said it was not necessary with newer versions of WearOs and Android. Likewise, I thought I needed node IDs to send the data but it is only for MessageCLient, not DataClient.

I also did some basic checks: watch and phone properly connected to one another, also logged into the same Google account (and same Samsung account for what it’s worth), on the same WIfi. I unpaired the watch and repaired. I reset completely the watch and repaired it to the phone. The google services on my watch is up to date as of January 2025 (24.49.33-705592033) and on the phone, Google play services is fully allowed and on high priority.

In the phone manifest, Google services wearable are there. I have the wearable.Bind.Listener and the wearable.data.changed. The data path is good e.g. “/session-data”.

All the modules (watch, phone, common for the data class) are recognized and declared in the gradle files.

I tried to develop a simple project just to pass a simple string from my watch to phone but couldn’t get it to work.

Since I am beginner, I would be glad to share some code with you, just ask anything.

Could Samsung prevent this communication?

I would be thrilled like never if somebody could get me out of this.

Thank you for reading me

Hello,
It’s a little long description and confusing. I did not understand very clearly.
Can you please share your exact problem right now in short step by step?
Did you get the data on your phone successfully?
You can check the companion app data send guide here:

This guide may help you to understand the communication between companion app.

Thanks!

Hi SNS_1205,
Thank you so much for your help!

Ok the short version: my watch app collects skating session data, and sends them to the companion phone app. But this does not happen, nothing arrives to the phone.
According to my toasts, the watch does send the data (“data queued for transfer”) but the phone does not receive them at all (the phone does not display any toasts at all that I set).

In my original post, I am telling what I tried to do to fix that. That’s why it is a been long.

If you wish any code, I’ll post them.

Regarding the guide you shared:

  • It is about MessageCLient (sends messages across devices) and not DataCLient (which I want)
  • Anyway, I tried to set a new projet as the tuto says. But I can’t get to have the same package names, Android Studio changes them. For instance the phone app package is com.example.test, and even though I put the same thing for the watch, Android Studio changes it itself to com.example.test.presentation… Weird