Introduction to Gson with Kotson library

JSON serialization and deserialization are very important for every Android application and are frequently used. For that purpose, we will be using the Gson library developed by Google. Also, we will use Kotson and Kotlin bindings for Gson. So, let's start!

First of all, we need to provide dependencies for our build.gradle configuration as follows:

    apply plugin: "" 
    apply plugin: "kotlin-android" 
    apply plugin: "kotlin-android-extensions" 
    dependencies { 
      compile '' 
      compile 'com.github.salomonbrys.kotson:kotson:2.3.0' 

We will update our code to use Gson with Kotson bindings for location serialization/deserialization in database management. ...

Get Mastering Android Development with Kotlin now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.