blblblblblblblblbl / weather-app

0 stars 0 forks source link

add more apis and add opportunity for user to choose #22

Open blblblblblblblblbl opened 1 year ago

blblblblblblblblbl commented 1 year ago

check this https://github.com/blblblblblblblblbl/weather-app/commit/63edf4a010b74c9bd36f8d1dc6a72623522f6f7b

blblblblblblblblbl commented 1 year ago

https://open-meteo.com/ free api

blblblblblblblblbl commented 1 year ago

https://habr.com/ru/companies/tinkoff/articles/728928/ Kotlinx.Serialization instead of gson, better because it's kotlin native and more in this article

blblblblblblblblbl commented 1 year ago

i didn't find how to use kotlin serialization for this purpose in this library adapter fixed to the class which its adapting or i can use polymorphic, but in this case I need to make super class for domain forecast response class and provide adapter in children? And gson is more comfortable in this case because I can create different adapters for domain Forecast Response and put them straight in retrofit, and this adapters will be simple because they use standart gson for different class coming from backend))) + extension function mapToDomain That's how for different servers I will have mappers in retrofit, I need them in Retrofit because I use sandwich library for errors handling withApiResponse<> generic so I don't know how to transfrom ApiResponse<class1> to ApiResponse<class2> in simple way for exapmle in Repository. That's why I decided to map classes inside retrofit

blblblblblblblblbl commented 1 year ago

https://open-meteo.com/ free api

this api require coordinates for request, user type city name, so I need to convert city name in coordinates geoapify api that I use for autocomplete, give not only city names but also coordinates. so I can use it