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
Shamas S
  • 7,507
  • 10
  • 46
  • 58

1 Answers1

12

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.

Shamas S
  • 7,507
  • 10
  • 46
  • 58
  • Depending on your API usage, you'll need different `intent-filter` parameters. Here's the official announcement and documentation: http://android-developers.blogspot.com/2016/04/deprecation-of-bindlistener.html – Sterling Apr 29 '16 at 14:34
  • 1
    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) – Sanket990 Jul 28 '16 at 07:22