I currently have an object that prints out as such
Country(code=AD, name=Andorra)
but I need to convert it into json. Is there a stringify method or something I can use from kotlin stdlib in android? Most questions I look up on stackoverflow want me to bring in gson, but I really dont want to bring in a depedency for just this single little manipulation. Am I missing something basic here?
t
Tolriq
04/20/2022, 6:39 AM
If you bring something bring Moshi 🙂 You can use the plain JSONObject too, or use kotlinx serialization. But there's no magic to talk json you need something that talk json and there's nothing in stb lib.
c
Colton Idle
04/20/2022, 6:41 AM
Hm. I can use JSONObject but its not part of stdlib?