java - Parsing json array with no name in android -


i have json array string no name , want parse how can in android ?

my jsonarray :

  [   {      "categoryid":1,     "title":"rock",     "songs":null   },     {      "categoryid":2,     "title":"jaz",     "songs":null     }   ] 

try this..

jsonarray jsonarray = new jsonarray(json);  (int = 0; < jsonarray.length(); i++) {         jsonobject jsonobj = jsonarray.getjsonobject(i);        system.out.println("categoryid : " + + " = " + jsonobj.getstring("categoryid"));        system.out.println("title : " + + " = " + jsonobj.getstring("title"));        system.out.println("songs : " + + " = " + jsonobj.getstring("songs")); } 

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -