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