5
I need to pass these values from a json file to a java class file, 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 on android now and I must be forgetting or missing something very basic,anyone knows why inputStreamReader is not cool?
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
Gson gson = new Gson();
Items Items = gson.fromJson((BufferedReader) mapaNomes, Items.class);
This is Sopt, please translate your question into English.
– Bruno César
I need that you perceive that this community speaks Portuguese.
– Victor Stafusa
I didn’t even know I was Portuguese,...
– Vinicius Nascimento