Ziad Halabi
Ziad Halabi

Reputation: 866

Android Wear RemoteControlClient add Like Button

I am developing an App that has a lock screen widget where it has a play, pause, prev and next. When I connect my phone to an Android wear, it automatically shows this buttons and it works fine. I would like to add a "Like" button that would automatically be shown on the lock screen and the android wear. I know that I can create a Notification and add action for the like. But I want to know if is it possible to achieve that using only RemoteControlClient?

Upvotes: 1

Views: 105

Answers (1)

Pierre Maoui
Pierre Maoui

Reputation: 6384

Have you tried using rating with the flag FLAG_KEY_MEDIA_RATING ? It seems that it's the only way to maintain generic methods and avoid having to set custom code on the wear side (or through notifications).

This flag can be set with setTransportControlFlags

Flag indicating a RemoteControlClient supports ratings. This flag must be set in order for components that display the RemoteControlClient information, to display ratings information, and, if ratings are declared editable (by calling addEditableKey(int) with the RATING_KEY_BY_USER key), it will enable the user to rate the media, with values being received through the interface set with setMetadataUpdateListener(OnMetadataUpdateListener).

Unfortunately, few or not example exists on the web. I discovered only one (unanswered) question relative to this on SO : Android 4.4 KitKat Rating API

Upvotes: 0

Related Questions