I want to create a JSON string like this:
[{"addon_id":2,"addon_rate":1550},{"addon_id":3, "addon_rate":300}]
Is this possible? How?
My code as it stands:
String formattedString = BookingDetailsCartAdapter.addones_id.toString().replace("[", "").replace("]", "").trim();
String formattedString1 = BookingDetailsCartAdapter.addones_rate.toString().replace("[", "").replace("]", "").trim();
myjson="[{\"addon_id\":\""+formattedString+"\",\"addon_rate\":\""+formattedString1+"\"}]";