CSV to Json to Java Object using Gson

I had a requirement to parse a json data in android. I used the following online services to quickly get the json format from excel and then convert it into Java class using Gson notation.

  1. Convert the excel data into csv format. Paste one record from the CSV file here https://shancarter.github.io/mr-data-converter/ . At the bottom pane you can see the json data
  2. Copy the parsed json data and paste it here http://www.jsonschema2pojo.org/
    1. Enter the java package name and other optional params
    2. Click “preview” and you get the Java class.

Copy the Java class and use it in the project.

Leave a Reply

Your email address will not be published. Required fields are marked *