use gson library in android code example
Example: gson dependency android
dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
}
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>