BharathVishal/Message-communication-using-Wearable-Data-Layer-for-Android-Wear-OS

Pairing Problem

Closed this issue · 12 comments

Hello! First of all let me thank you for your repository! It's amazing.

I am trying your code and i have paired the two devices (mobile and wearable) via bluetooth but when the mobile search the wearable I get the message
A wearable device is paired but the wearable app on your watch isn't open. Launch the wearable app and try again.

I have tried to reopen the wearable application but nothing.

Any suggestions?

Hi,
Once you have paired the wearable device through "Wear OS by Google Smartwatch" app, you need to make sure that this app is open on both the wearable and mobile device.

When this app is launched and kept open on both the mobile and wearable device, you can transfer or receive messages and the message you mentioned won't be displayed. This was the intended functionality as the wearable data-layer listener is tied to the activity lifecycle.

Hope this helps.

The wearable is Samsung Watch 4 and as i read the wear os by google doesnt work. Any suggestions?

Hi,
Could you try pairing your Samsung Watch 4 using the "Galaxy Wearable (Samsung Gear)" app and then install this app on your wearable and your mobile device. Make sure bluetooth is switched on and keep the activity of this app open on both the devices. This should fix probably the connectivity issue and then you can transfer messages between the devices. Hope this helps.

It is actually paired with the Galaxy Wearable app

@BharathVishal Any other suggestions ?

Hi,
I couldn't think of any other suggestions for this issue at the moment. Based on the message flow it means that the wearable device is actually returned by the wearable data layer's getNodes method, but the message isn't receiving due to the wearable app not being in foreground.

Could you keep this app's activity open on your wearable device without any sleep enabled like shown in this screenshot and your mobile version open as shown in this screenshot.

Also, please check if both the devices have Google Play services installed.

Actually after a while the wearable part maybe is going to sleep..Am i doing something wrong?

Hi,
The issue seems to be due to the watch going into sleep mode which is triggering the Activity's onPause() method that removes the wearable data-layer listener. Increase the screen timeout of your wearable device to fix this issue.

Goto Settings -> Display -> Screen Timeout-> Set it to One minute.

Please check if this fixes the issue. You need to make sure that the app on the wearable device doesn't goto background or enter into ambient mode. This should possibly fix the issue.

An alternative way to fix to the issue is by moving the removelistener methods to onStop of the MainActivity's class.

Hi,
Could you check the suggestions in the previous message, so I can close this issue?

I did all the above but still the onMessageReceived is never called

All i want is to send from wearable to mobile. Is there any other way to do it?

Hi,
The only way i can check the reason for this issue is by debugging with a Galaxy Watch 4 or a Samsung wearable device. Since, the app works as intended on my Fossil Gen 4 device, paired through Wear OS app and in Android Studio Wear OS emulators, I'm unable to find out the exact reason as to why this is happening only on Galaxy watch devices.