I am looking for a practical way to convert json s...
# android
r
I am looking for a practical way to convert json string to a map using kotling (I do not have a data class for it as it will be mutable)
t
@rCorbellini can you expound further, so i can get your question clearly
r
i Have a string Json and need it as a Map<key,value>
t
@rCorbellini You should be able to achieve this with Klaxon. With this you can easily read the Json data as JsonObject which is actually a MutableMap. Here is an example val jsonResult: JsonObject = Parser().parse(jsonString) as JsonObject https://github.com/cbeust/klaxon
g
Use any Json library for that. Klaxon is written for Kotlin and on Kotlin, but nothing prevents you from usage of any Java library for that
👍 1