Hi, I am trying to fetch JSON data from an API in my kotlin android project. I tried researching about it but was unable to find a direct and easy method. Can anyone help me regarding the same?
I am trying to get the City Name and Temperature only.
v
Viral Thakker
07/07/2021, 9:52 AM
User GSON library to map json with POJO
👍 2
m
mertturkmenoglu
07/07/2021, 9:56 AM
You may want to look at GSON library. You can use SerializedName annotation and/or a custom deserializer
👍 1
f
FunkyMuse
07/07/2021, 10:38 AM
Use Moshi/gson or Kotlin serialization as an adapter for retrofit to serialization of the response