After completing the XML SAX Parsing now I am working on JSON Parsing in my application. Here I am providing you the Json
Response : {"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
Now I had referred one example of Json Parsing in which they had created a jString Object and I had a doubt in that particular line which is as under :
private String jString = "{\"menu\": {\"id\": \"file\", \"value\": \"File\", \"
Can anyone make me clear about it please. The Link of the Complete Example is as Under:
http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/
They are just creating a string that will look like:
They use
\
because the"
char has to be escaped.You can get a JSON object from the response like this (I assume you know how to take care of the response):