androidgracenote

Gracenote GNSDK is not retrieving genre on Android


I'm studiyng gracenote gnsdk in an android application. With the developer key I have, I can retrieve basic information about the music, but I can't retrieve info such as mood and genre.

Does anyone knows a way to get this information? I'm following the example, like this:

String genre = gnAlbum.trackMatched().genre(GnDataLevel.kDataLevel_1);
if(genre == null || genre.isEmpty()){
    genre = gnAlbum.genre(GnDataLevel.kDataLevel_1);
}

Thanks in advance!


Solution

  • according to the docs you have to load a locale object to get genre results, e.g.

    mGnLocale = new GnLocale(GnLocaleGroup.kLocaleGroupMusic, GnLanguage.kLanguageEnglish, GnRegion.kRegionGlobal, GnDescriptor.kDescriptorDefault, mGnUser);
    mGnLocale.setGroupDefault();
    

    this takes quite a while so you might want to run that in a separate thread.