If you already have a service that extends MediaBrowserService , you can get any metadata in onLoadChildren .
In your onLoadChildren you should use MediaMetadata :
Contains metadata about an item, such as title, artist, etc.
From which you can get things like artist, title, etc. using MediaDescription :
A simple set of metadata for a multimedia item suitable for display.
@Override public void onLoadChildren(final String parentMediaId, final Result<List<MediaItem>> result) { for (MediaMetadata track : mMusicProvider.getMusicsByGenre(genre)) {
You can see a clearer implementation of this in this example .
source share