https://kotlinlang.org logo
#android
Title
# android
r

rwachol

09/15/2016, 10:48 AM
Copy code
import com.github.salomonbrys.kotson.*

    val p = Person("bob", 23)
    
    val json = "{ name: \"alice\", age: 25}"

    val gson = Gson()

    val personFromJson = gson.fromJson<Person>(json)

    print(personFromJson)

    print(gson.toJson(p))
seems okish