i "Kategori" almak istiyorum dizi tepkisini nasıl ele Json verilerini ayrıştırmak ve kategorisine göre "Başlık" & "Fiyatı" zaten Volley JsonArrayRequest burada
JsonSchema2Pojo
gelen pojo sınıfları oluşturulmuş almak istiyor için gibi Volley & GsonRequest sınıfını kullanarak im taşıma cevabı: JsonArrayRequest req = new JsonArrayRequest(URL, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Log.d("response....",""+response);
if (response != null) {
showProgress(false);
Gson gson = new GsonBuilder().create();
try {
Log.d("response....", "G00D");
Item items = gson.fromJson(response,Item.class);
JSONArray json = new JSONArray(response);
Log.d("arrayJSon",""+json.get(0));
//What is need to do here tell me solution please.........................
//.................dosomething here.......................
}
Benim json tepki geçerli:
[{
"category": "Espresso & Coffee",
"items": [{
"title": "Vacuum Coffee",
"size": [{
"label": "medium",
"price": 125
}, {
"label": "large",
"price": 145
}]
}, {
"title": "Cafe Latte",
"size": [{
"label": "small",
"price": 115
}, {
"label": "medium",
"price": 135
}, {
"label": "large",
"price": 150
}]
}, {
"title": "Cafe Mocha",
"size": [{
"label": "small",
"price": 115
}, {
"label": "medium",
"price": 135
}, {
"label": "large",
"price": 150
}]
}, {
"title": "White Mocha",
"size": [{
"label": "small",
"price": 120
}, {
"label": "medium",
"price": 145
}, {
"label": "large",
"price": 155
}]
}, {
"title": "Caramel Macchiato",
"size": [{
"label": "small",
"price": 125
}, {
"label": "medium",
"price": 145
}, {
"label": "large",
"price": 165
}]
}, {
"title": "Coffee De Leche",
"size": [{
"label": "small",
"price": 130
}, {
"label": "medium",
"price": 145
}, {
"label": "large",
"price": 160
}]
}, {
"title": "Cafe-UK Coffee Lava",
"size": null,
"price": 145
}]
}, {
"category": "Frappe",
"items": [{
"title": "Coffee Base",
"size": [{
"label": "small",
"price": 140
}, {
"label": "medium",
"price": 155
}, {
"label": "large",
"price": 170
}]
}, {
"title": "Milk Base",
"size": [{
"label": "small",
"price": 130
}, {
"label": "medium",
"price": 145
}, {
"label": "large",
"price": 160
}]
}, {
"title": "Cream Soda Float w\/Ice-cream",
"size": null,
"price": 140
}]
}, {
"category": "Milk Tea & Juice",
"items": [{
"title": "Milk Tea",
"size": [{
"label": "small",
"price": 105
}, {
"label": "medium",
"price": 120
}]
}, {
"title": "Hot Tea",
"size": null,
"price": 120
}, {
"title": "Italian Soda",
"size": [{
"label": "small",
"price": 105
}, {
"label": "medium",
"price": 120
}, {
"label": "large",
"price": 140
}]
}, {
"title": "Juice",
"size": null,
"price": 105
}]
}, {
"category": "Food",
"items": [{
"title": "Ultimate Chili Con Fries",
"size": null,
"price": 290
}, {
"title": "Nachos",
"size": null,
"price": 290
}, {
"title": "Marble Potato Fondue",
"size": null,
"price": 120
}, {
"title":"Breakfast",
"size":null,
"price":220
}]}]
Ayrıştırmaya çalıştığınız alanlar nelerdir? – malli
"Kategori" almak istiyorum ve Kategorisine göre "Başlıklar" ve "Fiyat" kategorisine göre Üç Alanı Göstermek için RecyclerView'ı kullanıyorum. – Dinesh