The JSON you are trying to generate
{"total":1,"rows":[{"id":1,"name":"Chai","price":18.00}],"footer":[{"name":"Total","price":18.00}]}
is a JSON object. As such, you can't use an array
Object[][] array = {
{"total",qty},
{"rows", lp}
};
to generate it.
Instead, create a POJO class with fields for each JSON name/value pair you want. One for total
(which is a number), one for rows
(which is an array/list of properties), and one for footer
which is some other object).
You can then create an object, initialize its fields, and serialize it with Gson (or other JSON serializer).