Android Development

How to create any API response model class in android java

How to create any API response model class in android java
  • Developer use API calling retrofit, volley JSON or other tools but API response check-in postman time confusion how to creating this response model class
  • So a friend in this topic I will try your confusion remove flow below all steps and 5 min inner creating a wonderful model class

Step: 1 Android studio in install “RoboPOJOGenerator”

  • Location in the android studio:
    • Open android studio
    • Go to File
    • Go to Setting
    • Click plugin
  • Check the below image && click and install RoboPOJOGenerator then your android studio restart
Android studio in install "RoboPOJOGenerator"

Step: 2 How to open RoboPOJOGenerator

  1. Open android studio
  2. Go to File
  3. Select directory below the image in showing related select any one directory
  4. Right-click – select New – then below showing “RoboPOJOGenerator”
How to open RoboPOJOGenerator

Step: 3 How to add postman response

  1. Postman response copy
  2. Paste this response in “RoboPOJOGenerator” in one black color dialog showing in android studio
  3. Left top side one cursor visible on this area in paste this response
  4. Select “GSON” option in “RoboPOJOGenerator”
  5. Last click generate button after a few moments your model class is ready
How to add postman response
Step: 3 How to add postman response
Share On: