Created
October 12, 2014 05:52
-
-
Save msomu/fe918a2d20ca85935f9f to your computer and use it in GitHub Desktop.
JSON Parsing For Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try{ | |
JSONObject jsonObject = new JSONObject(s); | |
JSONObject propertiesObject = jsonObject.getJSONObject("properties"); | |
JSONObject idObject = propertiesObject.getJSONObject("id"); | |
String s1 = idObject.getString("type"); | |
Log.d("Type",s1); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
name: "Product", | |
properties: { | |
id: { | |
type: "number", | |
description: "Product identifier", | |
required: true | |
}, | |
name: { | |
description: "Name of the product", | |
type: "string", | |
required: true | |
}, | |
price: { | |
type: "number", | |
minimum: 0, | |
required: true | |
}, | |
tags: { | |
type: "array", | |
items: { | |
type: "string" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment