1
I got the following String:
[{"Monstro":"Lobo","HP":100,"Level":2},{"Level":"1","HP":"100","Monstro":"Bruxa"}]
And I need to put her inside a Array ou List
to take the values of each monster.
- How do I do it?
I’m sorry if the doubt seems obvious.
OBS: are data from JSON that are within the […]
as normal as this and has the },{
between them that seprar the 2 different values that are within the [...]
.
The best way to do this is by creating a class and parsing in json for a class object. Make sure you want to do so?
– Francisco
yes I use the org.json api which does not support parce and I am running some tests before I even assemble that part of the api. taking advantage as a challenge to myself.
– Bits of Bytes
Need to be an array? Cannot use
List
?– Renan Gomes
@Renan can be any way for me to choose which of the two dice to pick.
– Bits of Bytes
Okay, is your JSON wrong anyway or was it time to move here to the question? There are different keys in the objects
Monstro
andMonstro:
.– Renan Gomes
@Renan I didn’t even realize I had to tidy up td since Ctrl+c/Ctrl+v bugged my keyboard
– Bits of Bytes