I need to pass these values from a json file to a java class, the Json file is of this type:
{
"id":1,
"name":"Gold",
"description":"Shiny!",
"spriteId":1,
"consumable":true,
"effectsId":[1]
},
I created a map this way:
Items i = new Items();
Map<String, Items> mapaNomes = new HashMap<String, Items>();
mapaNomes.put("Gold",i);
mapaNomes.put("Apple",i );
mapaNomes.put("Clain Mail",i );
The problem is when reading the json file, I started the program in android now and I must be forgetting or missing something very basic, does anyone know why the inputStreamReader is not legal?
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Gson gson = new Gson();
Items Items = gson.fromJson((BufferedReader) mapaNomes, Items.class);