How to store array of objects in a variable in kotlin
There is a handy JSON to Kotlin converter, which converts json to this classes:
data class UserModel (
@SerializedName("articles" ) var articles : ArrayList<Articles> = arrayListOf(),
@SerializedName("user_id" ) var userId : Int? = null
)
data class Articles (
@SerializedName("mobile" ) var mobile : Int? = null,
@SerializedName("name" ) var name : String? = null
)