0

I have successfully implemented communication between my phone and watch app through WearableListenerServices in both modules. This works perfectly for the most part, however, if i don't use the phone app in a while the watch app stops communicating. This suggests the WearableListenerService is not "woken" up as expected. To fix this, I have to open the phone app and for the next while the watch app communicates perfectly again.

Is there a way I can guarantee that it will be "woken" up? Or am I missing something?

Phone manifest:

<service android:name=".app.util.ListenerService">
            <intent-filter>
                <action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />

                <data
                    android:host="*"
                    android:scheme="wear" />
            </intent-filter>
        </service>

Wear app:

<service android:name=".util.ListenerService">
            <intent-filter>
                <action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
                <data
                    android:host="*"
                    android:scheme="wear" />
            </intent-filter>
        </service>

If you need more on the specific implementation of the listeners I'm happy to provide it, but it doesn't seem relevant. Thanks!

Adam Short
  • 498
  • 7
  • 28
  • Have you ever got this working? Same issue here – user2161301 Mar 22 '18 at 20:57
  • @user2161301 unfortunately not sorry, I've also moved away from Android dev so I can't point you in any direction either. – Adam Short Mar 23 '18 at 21:52
  • Thanks for your response. Got it working like 80% of the times now by updating GMS or whatever the API need to work but 80% still is really bad, let's see what I can find – user2161301 Mar 29 '18 at 20:19

1 Answers1

0

We all knew that the BIND_LISTENER for wearable app is already deprecated and it is replaced by a fine-grained intent filter. So make sure that you use a correct filters for your app. You can know the meaning and purpose of individual filters here.

Try to check this documentation for Building Apps for Wearables, it shows you how to use the WearableListenerService for your app. It also provide some sample code that you can verify if you properly implemented this code in your application.

KENdi
  • 7,576
  • 2
  • 16
  • 31