Good evening everyone.
There is a JSON
file that needs to be parsed. JSON
structure below:
{ "Italiano" : [ { "Хлеб" : [ {"title" : "Тосты", "image" : "664e5b1b1d8a165606df981e2ac3a94e.png", "price" : "39", "weight" : "90", "kkal" : "716", "description" : ""} , {"title" : "Лепешка Фокачи", "image" : "0761a99a6b6bd8f7d359436b81148e44.png", "price" : "39", "weight" : "110", "kkal" : "463", "description" : ""} , {"title" : "Хлебная корзинка", "image" : "20ae95142285d371239a3f2276a3a044.png", "price" : "20", "weight" : "100", "kkal" : "171", "description" : ""} ] } , { "Итальянская пицца" : [ {"title" : "«МАМА ROOMA» 25 см.", "image" : "d7d4141657a3e200f0985dce2833c12b.png", "price" : "379", "weight" : "360", "kkal" : "", "description" : ""} , {"title" : "«МАМА ROOMA» 32 см.", "image" : "d7d4141657a3e200f0985dce2833c12b.png", "price" : "479", "weight" : "550", "kkal" : "", "description" : ""}
The full file: http://zalil.ru/34710700
When parsing, it is necessary to create an array of categories (Bread, Italian pizza, etc.), and then parse each category separately. I can open the file, I can create both JSONObject
and JSONArray
and even I can do all this in the background thread. But the problem is that I’ve been blunt for two hours, but how can I not write an algorithm for parsing this file? Please help! Apparently I myself will not get out of this stop! Thank you in advance!