Universal Player Music with Web Services

Asked

Viewed 40 times

0

Someone has already made an application with a music player coming from a webservices?

I’ve been searching one and found the android-Universalmusicplayer from Google open source, but have a snippet of code that I’m unable to adapt to my own webservices

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

This line that is above I change to my own URL, but when I do not appear any music, someone has already done using Retrofit?

1 answer

1

Hector,

If you access to url, will see how is made the structure of Json that they have created.

In order for you to just change the URL to your Webservice, it should look exactly like the one created by the Google example.

In it, there is a key called music which is a 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 the information regarding the songs, you need to either leave exactly the same, or change the parsing of the array according to your Json.

  • Up to this point everything well understood, the point is that I wanted to do with retrofit, and the webservices I use Codeigniter Restful, but the results were not successful, and look that I am following the pattern of this json structure.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.