jeudi 21 janvier 2016

How to set up databases in Android to perform searches between them

What I have now I am building an app that is going to deal with recipes. Currently, I have sort of a locker where you can add your items that you want in that locker. That could be, for example, a pack of minced beef or a loaf of bread or what not. I let the user add this in the app, depending on what they have in their locker/fridge/freezer. I am doing this, using SQLiteDatabase. Everything works the way I want it do, but now, I want to add some more features.

What I want to achieve

Okay, so in my app, I have a search button. When a user wants to search, he should be able to type an ingredient (like minced beef) and then receive results of recipes containing minced beef. He should also be able to search for a recipe and then get to that recipe, or recipes similar to the one he typed in.

Scenario 1. A user searches for an ingredient.

What should happen The user should get results on all recipes containg that special ingredient. When the user finds a recipe that he likes, he should be able to click on it and the app should show what ingredients he have at home and what ingredients he needs to purchase.

Scenario 2. A user searches or a recipe

What should happen. The user gets result on the recipes that matches his search. If he clicks on one, the ingredients that he has should show (as in Scenario 1) and the ones he needs to purchase should also show, also as in scenario 1.

The question

How should I, as efficiently (in terms of execution time) as possible set up the databases to be able to display information from different databases with one search. I found this http://ift.tt/1x3NjSD, from what I'm guessing that I will need multiple databases. I do not need help to code the setting up phase, but merely how the structure of databases should be designed.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire