{
"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}
}
Asked
Active
Viewed 69 times
-2

Lyubomyr Shaydariv
- 20,327
- 12
- 64
- 105

Muhammad Adeel
- 21
- 5
-
android studio using httpurl connection – Muhammad Adeel Jan 25 '17 at 08:40
-
5Welcome to Stack Overflow. We are not here to write code for you . Mention specifically where you are having problem . – Rishabh Maurya Jan 25 '17 at 08:45
-
This answer has some good examples for what you want to achieve: [link](http://stackoverflow.com/a/9606629/991200) – Nelson Almendra Jan 25 '17 at 10:18
2 Answers
0
First, create your Models to parsing this JSON array. you can use JsonUtils and other JSON online tools to generate your models.
Then you have to use some tools to parsing (deserialize) JSON into your models. GSON is one of this tools. finally, you can get your data from your models and set them into the views.

FarshidABZ
- 3,860
- 4
- 32
- 63
0
Here you have a JSON object array so first you have to get the widget
JSON object and then from the tag(value) of "window" get the inner JSON array. from that get the other objects.
{ "widget":
{ "debug": "on",
"window":
{ "title": "Sample Konfabulator Widget", "name": "main_window", "width": 500, "height": 500 },
"image": { "src": "Images/Sun.png", "name": "sun1", "hOffset": 250, "vOffset": 250, "alignment": "center" },
"text": { "data": "Click Here", "size": 36, "style": "bold", "name": "text1", "hOffset": 250, "vOffset": 100, "alignment": "center", "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" }
}
}
Refer a tutorial on how to manipulate JSON objects in Android.
have fun coding.

Lyubomyr Shaydariv
- 20,327
- 12
- 64
- 105

Tharusha
- 635
- 8
- 25