parsing my given JSON in android -
i have json , please explain how parse given json value. want value 2 in textview shown. can please explain me. below json :
{ "name": "nbusers", "args": [ { "nb": 2 } ] }
http://www.tutorialspoint.com/android/android_json_parser.htm
you can learn json parsing here.
try { jsonobject result=new jsonobject("your result"); //your json value parameter jsonarray array=result.getjsonarray("args"); jsonobject finalresult=array.getjsonobject(0); string nb=finalresult.getstring("nb"); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace(); } //your result here
Comments
Post a Comment