Universal Music Player with Web Services

0

Has anyone made an application with a music player coming from a webservice?

I've been looking for one and I've found the open source android-UniversalMusicPlayer for Google, but there's a snippet of code that I can not adapt to my own webservices

protected static final String CATALOG_URL = "http://storage.googleapis.com/automotive-media/music.json";

This line above I change to my own URL, but when I run no music appears, has anyone been able to do it using Retrofit?

    
asked by anonymous 09.10.2017 / 15:15

1 answer

1

Hector,

If you access url , you'll see how the Json framework they've created is done.

In order for you to only change the URL for your WebService, it must be exactly the same as the one created by Google's example.

There is a key called music that is an array :

{"music" : [ 
    { "title" : "Jazz in Paris",
      "album" : "Jazz & Blues",
      "artist" : "Media Right Productions",
      "genre" : "Jazz & Blues",
      "source" : "Jazz_In_Paris.mp3",
      "image" : "album_art.jpg",
      "trackNumber" : 1,
      "totalTrackCount" : 6,
      "duration" : 103,
      "site" : "https://www.youtube.com/audiolibrary/music"
    }
]}

And within each loop of the array, there is information about the songs, you need to either leave it exactly the same, or change the array parsing according to your Json.

    
09.10.2017 / 15:31