How to use RoboPOJOGenerator to automatically generate model class from Json in Android Studio

Thientvse picture Thientvse · Dec 8, 2017 · Viewed 7.9k times · Source

I will share a way to generate class from Json in Android.

Generate Java and Kotlin POJO files from JSON: GSON, AutoValue, Logan Square, FastJSON, Jackson, Moshi, empty annotations template. Supports: primitive types, multiple inner JSONArrays.

This is a demo:

enter image description here

You can download it from : "Preferences" -> "Plugins" -> "Browse Repositories" -> "RoboPOJOGenerator"enter image description here

And how to use:

enter image description here

And you paste you json to popup and choose parser type:

enter image description here

And click generate, it will gen class from json for you!

enter image description here

I hope it can help you to save many time!

Answer