Android 4.4 KitKat Rating API

I really like to use the new Android 4.4 "Ratings from remote controllers", but it does not look like they use it, even Google Play Music; which I would expect to give as an example.

I am interested to know if anyone had any luck in the applications that answer these challenges: https://developer.android.com/about/versions/android-4.4.html

Exposure: Ratings from remote controllers

Android 4.4 builds on existing capabilities for remote control clients (applications that receive multimedia control events using RemoteControlClient), adding the ability for users to evaluate the current track from a remote control.

The new rating class encapsulates user rating information. The rating is determined by its rating style (RATING_HEART, RATING_THUMB_UP_DOWN, RATING_3_STARS, RATING_4_STARS, RATING_5_STARS or RATING_PERCENTAGE) and the rating value corresponding to this style.

So that users can rate your tracks from a remote controller:

A signal that you would like to give the user a rating (if applicable) by adding the FLAG_KEY_MEDIA_RATING flag to setTransportControlFlags (). Call editMetadata () to retrieve RemoteControlClient.MetadataEditor and pass it to RATING_KEY_BY_USER using addEditableKey (). Then specify the rating style by calling putObject () and passing it RATING_KEY_BY_USER as the key and one of the above rating styles as the value.

+4

Source: https://habr.com/ru/post/1540251/


All Articles