I'm doing an app on Android that should show some information about the inventory of different stores, to access the bd I use a web service (I use a stored procedure but I do not have permission to manipulate this information) and already in the main I have a Products Entity that stores store, product_code, product_name, size and quantity and I need to show that data in matrix form, the sizes should be as headings of the table, something like this:
Store | Product_code | Product_Name | 15 | 15.5 | 20 | 20.5 | .....
5 | 191783 | PIRMA FOOTWEAR | 0 | 2 | 0 | 1 | ....
I do not know if anyone could guide me on how to save the Entity's data in a two-dimensional array or an Arraylist in JAVA.
In the for cycle I go through what I find, then I save the data in variables and I pass them to an object called Talla and that object I keep it in an ArrayList (listTallas), but it's costing me a lot to accommodate the sizes as headers and that the quantities match.
for (int i = 0; i < t.getPropertyCount(); i++) {
SoapObject bank = (SoapObject) t.getProperty(i);
String tienda = bank.getProperty("Tienda").toString();
String p_talla = bank.getProperty("Producto_talla").toString();
String nombre_producto = bank.getProperty("Nombre_Producto").toString();
String talla = bank.getProperty("Talla").toString();
String cantidad = bank.getProperty("Cantidad").toString();
Talla oTalla = new Talla(tienda, p_talla, nombre_producto, talla, cantidad);
listaTallas.add(oTalla);
}
Once the data of the object is passed to the list, I use it to create the table with a tablelayout, but I do not know how to make the quantities match the sizes and that the sizes do not come back to me, that a product can have several sizes. I do not know if there is any function that serves as it does in Visual datagridviews or something similar.