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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.