Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build error Bind_Listener is deprecated

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
like image 747
Shamas S Avatar asked Apr 29 '16 09:04

Shamas S


1 Answers

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.

like image 66
Shamas S Avatar answered Oct 14 '22 22:10

Shamas S