Ho bisogno di analizzare un file JSON wich è simile al seguente:JSON Array di oggetti Java
[
{
"y": 148,
"x": 155
},
{
"y": 135,
"x": 148
},
{
"y": 148,
"x": 154
}
]
e voglio mettere queste coordinate X e Y coordinate in un JavaObject Click, quella classe assomiglia a questo :
public class Click {
int x;
int y;
public Click(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
ho guardato GSON perché dicono che è facile uscire, ma io non farlo come posso farlo dal mio file.
'[]' è un array, '{}' è un oggetto. –