Gson library in Android Studio

后端 未结 6 582
轮回少年
轮回少年 2020-12-02 21:48

Can someone give me step by step guide to add the Gson library to an Android project?

I tried the JSON built-in library but that seems to be a bit tedi

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-02 22:11

    Read Google-gson

    Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.

    Add the following line to your MODULE LEVEL build.gradle configuration:

    dependencies {
         implementation 'com.google.code.gson:gson:2.8.5' // Old 2.8.2
    }
    

提交回复
热议问题