android - How to write Json Parser class from this .json file -
i want media player (android) should play songs urls . , using json file update playlist file daily. please me got stuck on thanks.
{ "json": { "songs": [ { "song": "song name ", "artist": "sonjay singh", "mp3": "http://c2lo.reverbnation.com/audio_player/download_song_direct/9140921.mp3" }, { "song": "song name", "artist": "aritist", "mp3": "mp3_url" }, { "song": "song name", "artist": "aritist", "mp3": "mp3_url" } ] } }
i made class still finding difficult how use it.. helping me.
public class json{ private list songs; public list getsongs(){ return this.songs; } public void setsongs(list songs){ this.songs = songs; } }
//
public class songs{ private string artist; private string mp3; private string song; public string getartist(){ return this.artist; } public void setartist(string artist){ this.artist = artist; } public string getmp3(){ return this.mp3; } public void setmp3(string mp3){ this.mp3 = mp3; } public string getsong(){ return this.song; } public void setsong(string song){ this.song = song; } }
//
public class songsdatabase{ private json json; public json getjson(){ return this.json; } public void setjson(json json){ this.json = json; } }
parse google gson - load url media player, job done.
Comments
Post a Comment