You need to use:
Product p = new Product(); p.setId( jsonArray.getJSONObject(i).getInt("id") );p.setName( jsonArray.getJSONObject(i).getString("name") );list.add(p)
All inside the loop, because you need to create a new product each time.