I want to create a shopping list, where all the ingredients are listed.
Before, a function should check each meal (like "Kartoffelsuppe", "Erbsensuppe" ... ) if there exists same ingredients like "Wasser" and add them together.
The result should shown as a list like:
Kartoffeln: 500 Gramm
Erbsen: 775 Gramm
Möhren: 375 Gramm
Wasser: 4 Liter
I am thinking about it for a whole week and tested around but don't get it ...
Explanation:
On Screen1 there is a list with all the meals available.
Button "Gericht hinzufügen" go to screen "AddMeal".
On "AddMeal" I want to create a new meal (at this point only with three ingredients).
First txt-box is for the name of the meal,
second for ingredient 1 followed by the amount and the list picker is for the unit (e.g.: "Erbsen" "500" "Gramm").
The same goes for ingredient 2 and 3.
After clicking the button "Hinzufügen" the meal with its ingredients is inserted to the database.
Screen "Testscreen" is for .. jeah creating the aboved described situation and then implementing it in addMeals Screen ...
Some of the blocks are there just for testing around. Some blocks are not final ...
The greater txt-box and the list-view are just understanding for me and securing that it is doing what I want. (^.^).
as @ABG already mentioned, this could be done much easier with tables...
and let me add, why not using the built in SQLite database to easily create, filter and join tables?
see my sqlite extension here App Inventor Extensions: SQlite | Pura Vida Apps to access the database
note: there are also other sqlite extensions available...
your query to get the receipt for Kartofelsuppe could look like this SELECT ingredients FROM receipts WHERE receiptname = "Kartoffelsuppe"
I just stumble over the CSV ... you have 4 colums, each row there have one value - I don't get it how it will do for more values, like:
Meal_One, ingredient_1, ingredient_2, ingredient_3 [...], amount_ingredient_1, amount_ingredient_2 [...] and so on.
There are meals with just 2 ingredients and meals with 10+ ingredients.
I want to prepare some meals as a standard, but it will also be fully costumizable: the user can add own meals with his own ingredients. And in that case maybe water as an ingredient will not be at the same place in the list ...
You say there is a built-in SQLite database? Which of the storage items I should choose then? I did'nt find it or am I just blind? Or I don't understand it ...
Although thanks for your extensions. I bought the billing extension already.
the SQlite databae is available on all Android devices, also Android itself is using it...
unfortunately there is no built in sqlite component available, you have to use an extension to work with it...