Hello.
Please explain how Retrofit works. There is a page with json. In android connected Retrofit, okhttp, converter-gson. json this:
{"1": {"id":101, "item":"NameItem1", "itemId":"1", "name":"NameName", "img":"http:cccccc.jpg"}, "2": {"id":102, "item":"NameItem2", "itemId":"3", "name":"NameName", "img":"http:cccccc.jpg"}, "3": {"id":103, "item":"NameItem3", "itemId":"2", "name":"NameName", "img":"http:sddfsssds.jpg"}} 1) In all examples, they write that you need to create a POJO class equivalent to JSON. I use http://www.jsonschema2pojo.org/ In my case it will be one MyClass. in which there will be variables Id, item, itemId, etc. with getters and settarmi. Or will it be several classes if you insert the whole json?
2) How does the get request in retrofit work?
public interface APIService { // Ниже пишу название файла с json? @GET("list") // В Call передаю просто MyClass? Или список из MyClass? // В getData в аргументах перечисляю все переменные которые в MyClass? Call<List<MyClass>> getData(@Query("id") int id, @Query("item") String item ...); }