Looking at this Json file, KEY is always a String, but VALUE sometimes is a String but sometimes is an typed object with two String fields.
How can I parse it using GSON?
{
"property": [
{
"key": "key_A",
"value": "value_A"
},
{
"key": "key_B",
"value": "value_B"
},
{
"key": "key_C",
"value": {
"param_C_1": "value_C_1",
"param_C_2": "value_C_2"
}
}
]
}
The first thing is parsing this json file to java that can be done
this way :-
Then make a class which will have all the values you got from the json file.
Say that class is MyClass, containing all of the values you got from json file.
make MyClass object and then
I hope this is what you want.