Tuesday, 15 June 2010

android - How to get values from JSON -



android - How to get values from JSON -

i have info in json format this:

{"datos":[{"cli_nombre":"futcho 7","suc_nombre":"naucalpan"}],"status":0,"mensaje":""}

the status , mensaje keys not in datos array. how can it?

i can values unique object, object has 2 keys cli_nombre , suc_nombre , don't have problems values keys.

regards

if have json in string, utilize next code status and mensaje:

jsonobject jsonobject = new jsonobject(yourjsonstring); int status = jsonobject.getint("status"); string mesaje = jsonobject.getstring("mensaje");

hope helps you! :)

android json

No comments:

Post a Comment