I have some model classes like Customer, Product, etc. in my project which have several fields and their setter-getter methods, I need to e
Customer
Product
Use gson to achieve this. You can use following code to get the json then
Gson gson = new Gson(); String json = gson.toJson(yourObject);