In my media app, I keep all the media items as MediaBrowserCompat.MediaItem I'm adding a rating to these items. To read the rating from a MediaItemCompact, Android provides
public RatingCompat getRating (String key)
what is the key parameter ? and how should I use this API to simple read the average users' rating ?
You can use
mediaMetadataCompact.getRating(MediaMetadataCompat.METADATA_KEY_USER_RATING);
to get user rating.Refer:
https://developer.android.com/reference/android/support/v4/media/MediaMetadataCompat.html#METADATA_KEY_USER_RATING
https://www.javatips.net/api/android-support-v4-master/src/java/android/support/v4/media/MediaMetadataCompat.java