teaching machines

Homework 2- jacoblj

October 19, 2011 by . Filed under cs491 mobile, fall 2011, postmortems.

Have you ever been at a friends, making your favorite recipe house and realized you can’t remember if it is two tablespoons of oil or three? This app is here to help. Recipe Box is a place to store your favorite recipes right on your phone.

This app allows you to choose what type of dish you want to view or add to. It will then move to a list that will allow you to either add a new item or to choose an existing recipe. If you choose to add a new item the app will save it into the correct category to be pulled up later. It allows you to delete or edit an existing recipe by long clicking the item on the list. Once you choose an item the app displays all of the information about the recipe. It also offers an option to text a list of ingredients needed to a inputed phone number.

String smsNumber = input.getText().toString();

String smsText = ingredients.getText().toString();

Uri uri = Uri.parse(“smsto:” + smsNumber);

Intent intent = new Intent(Intent.ACTION_SENDTO, uri);

intent.putExtra(“sms_body”, title +” shopping List ” + “\n” + smsText);

startActivity(intent);

The most difficult part of this app was working with the databases. For this I used three tables that were linked together, because of this I could possibly add an ingredient search to pull out recipes if they contain a specific ingredient. I had to look up how to write queries to join tables and was not able to find any methods in the android api to do this. I used a rawQuery to type in the SQL to join the tables so I could pull out the ingredients that relate to a specific recipe. Another part that took a bit of thought was how to add the recipes and ingredients so they could be given auto incremented id numbers. The reason this became difficult is because recipe have more than one ingredient. They had to be added and saved , then the recipe had to be added, and finally I put together a linking table so the used could have many ingredients in a recipe.

All in all this app turned out to be a good learning experience and I have some ideas of features that I would like to add to it in the future.

 

Luke Jacob