JSON data - How to parse?

JSON data - How to parse?



Suppose I have data in JSON. How can I parse the data so I can get the values of nested objects (e.g. kind, id and title)?


kind


id


title



My JSON data is:



"kind": "youtube#playlistItemListResponse",
"items": [

"id": "UExkc1JWcGJNV19LSH",
"items":[

"title": "New Updates",

],
],




1 Answer
1



Well you should remove all the commas since last items should not be followed by one.



So more like:



"kind": "youtube#playlistItemListResponse",
"items": [
"id": "UExkc1JWcGJNV19LSH",
"items": [
"title": "New Updates"
]
]



Other than that you can just use JSONObject lib and extract the value you need. For example to get the kind:


JSONObject jsonObj = new JSONObject(strInput);
String kind = jsonObj.getString("kind"); // kind now contains "youtube#playlistItemListResponse"



where strInput is the above json as a string.



More info: https://developer.android.com/reference/org/json/JSONObject





Thnx alot sir. Its the finalize answer for my this question. Thanks for your precious comment
– Pradeep Sheoran
Aug 29 at 18:52



Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

Node.js puppeteer - Use values from array in a loop to cycle through pages