Build error Bind_Listener is deprecated
Asked Answered
S

1

8

When I try to build my apk, it gives me error saying

Error:(190) Error: The com.google.android.gms.wearable.BIND_LISTENER action is deprecated.

This is my AndroidManifest looks right now

    <service
        android:name=".MyDeviceListenerService"
        android:enabled="true"
        android:exported="true">
        <intent-filter>
            <action
                android:name="com.google.android.gms.wearable.BIND_LISTENER"/>
        </intent-filter>
    </service
Serviceman answered 29/4, 2016 at 9:2 Comment(0)
S
13

Since Play Services 8.2, Bind_Listener has been deprecated.

The newer way is to use the fine grained intent filter API by specifying only the events you want to get notified for.

To get messages from the app all the time, change Bind_Listener to something like this

<service
    android:name=".MyDeviceListenerService"
    android:enabled="true"
    android:exported="true">
    <intent-filter>
        <action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED" />
        <data android:scheme="wear" android:host="*" android:pathPrefix="/request-network" />
    </intent-filter>
</service>

You can read more about it on the documentation.

Serviceman answered 29/4, 2016 at 9:2 Comment(2)
Depending on your API usage, you'll need different intent-filter parameters. Here's the official announcement and documentation: android-developers.blogspot.com/2016/04/…Skinny
Two way sending and received set above solution but not working .Sending message successfully to wear device but wear device not received issue . same thing wear sending message to mobile but not getting message to mobile (Bind Listener this issue is done but not working in above code)Pontormo

© 2022 - 2024 — McMap. All rights reserved.