I would like to know how to select the data using the gson library.
BufferedReader reader = null;
URL endereco = new URL("https://prod.api.pvp.net/api/lol/"+Server+"/v1.4/summoner/by-name/"+Jogador+"?api_key="+API_KEY);
try {
BufferedReader br = new BufferedReader(new InputStreamReader(endereco.openStream()));
Gson obj = new Gson();
System.out.println(br.readLine());
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException ignore) {}
}
}
I got this as a result:
{ "exemplo" : {
"id" : 1473077,
"name" : "Exemplo",
"profileIconId" : 25,
"revisionDate" : 1355854041000,
"summonerLevel" : 13
}
}