Hello. Noob here. i’m trying to build a recipe app with 2 main part with on device storage feature (“ingredient” database and “recipe” database) because i want to make it fully offline app…
1 the ingredients part. here user will be able to crud ingredient data such as ingredient name, weight / volume, and purchase price. thankfully i manage to make this part quite smoothly by watch/read some tutorial and forum answer.
now come the second part…
second part is where user supposedly make crud operation on a single recipe name (id) with bunch of ingredients data taken from part 1 ingredient database (name price, etc).
example table structure in excel
problem is, i cant figure out how to work crud with nested object/ list of object (btw still don’t know the difference between this two).
tried solution…
i try to separate “recipe list” database and “recipe ingredient list” database that correspond to the selected recipe id but facing several issue.
- the recipe number is static because
- couldn’t figure out how to create dynamic page form on the matter. (if list is press, open page with current id in page parameter. the if recipe id is loaded, call the ingredient data for that specific recipe (id). so i make it static (recipe 1 goes to recipe 1 page, recipe 2 goes to recipe 2 page and so on). manually create page per recipe with the necessary variable loaded…
then come problem, - the process i do in the static page is, first step user choose list of ingredient saved in part 1, transfer its value to page var, then save it to the “recipe ingredient list” database so it could show in the repeated list. after that, second step, save other user input value to the “recipe list” database. now in the scenario where user have done part or all of step one but they have to cancel the input prosses, close app, or app crash, the data in “recipe ingredient list” persist. so the next time user try to make a new recipe, a bunch of ingredient already exist in the page and the user had to delete or edit it one by one.
- the biggest problem is the ingredient in the recipe database not truly connected to the ingredients in the “ingredient list” database. means if user change the data in part 1 (“ingredient” database), it’s not automatically reflected in “recipe” or “recipe ingredient list” database in part 2.
so the question is. any suggestion on how to tackle this problem.?
thanks in advance.
namaste…