Track It

Developed by: Keith Martin ( and Brett Stevenson (

Programming Language: App inventor



The name of our app is Track It. This falls under a weight loss or a calorie counter application that allows the user to select from food groups to get an estimate on the amount of calories they are consuming on a given day. This will be socially useful because it will allow the users to keep track of their calories and it will be stored so that they can see their improvement overtime. It  also displays encouraging facts or tips that will keep the user motivated to eat healthy. Our intended audience is anyone who is trying to track their calories for losing or gaining weight depending on the scenario. This can apply to any age who wants to keep track of their weight. It will primarily be used by people roughly 17 and up because they know the significance of tracking calories.This app differentiates from other apps because it allows the user to pick from a predetermined selection of food and have the option to enter food that isn’t listed into the application. It will also display encouraging advice and facts about eating healthy to keep the user motivated. The FirebaseDB will be used to record the total calories a person enters on a given day. Buttons, Labels, Text boxes, If/then statements, FirebaseDB, procedures, global variables, PRNGs, list pickers, activity starters and TinyDBs.

Our app aims to solve the problem of people losing track of their caloric intake throughout the day. Our app allows the user to pick from a list of the top 10 most common foods in their respective categories as well as the ability to look up other foods that aren’t included on the application. There are many calorie counters out but they are usually limited to the foods in their database. These apps also only track calories and don’t have any encouraging tips or advice to offer the user as they track their calories. This gives the user motivation and the confidence to keep counting their calories and teaches them to eat healthier. Someone should try our app because it is a simple, yet effective calorie counter that also gives tips and encouragement to those using it. If someone has never counted their calories before they could get discouraged if they don’t meet their goals. Our application aims to solve that problem.






Story Board:

  1. The User clicks “Get Started”
  2. The User enters their Name, Age and Calorie goal and it is stored
  3. The User clicks submit
  4. The User clicks “Start Tracking”
  5. The User clicks “Breakfast, Lunch, Dinner or Other” and selects the food they would like to look up data is stored in FirebaseDB
  6. If food selection is not in list the User can click “look it up” to search and then enters the amount in textbox
  7. The User enters the calories and clicks submit
  8. The total calories and name are displayed next to the calorie goal.
  9. Eating advice is displayed
  10. The User can click back to continue tracking calories

Code Functionality:

We ran into the most trouble when it came to coding and setting up the FirebaseDB. This type of DB was not something that we had gone over in much detail in class so we had to learn how to do it with the help of the TAs and Ms.Lake. We originally had coded a tinyWebDB, but we had come to find out that we had too much data to store. This was another problem that we ran into. We had to store close to 40 foods into our database and it would constantly get overwritten by other people entering values into the tinyWebDB. We then decided to go with the FirebaseDB which we had trouble setting it up so that it would work with App Inventor and then we had trouble actually coding it into the application so that it worked properly. We were eventually able to figure out how the database worked with a guide provided by Ms. Lake and personal help from Selina and Ms. Lake. We also had a small amount of trouble getting the data from the database to store into the global variable because the data was stored as strings rather than numbers. In order to fix this I added a text box where the user manually submits the amounts of calories and the value is directly added to the global variable Total Calories. Me and My Partner both worked together through most of the coding and while we were figuring out how to use the databases. I did the UI and he entered the data into the database.

App functionality:

User clicks get started.

User submits their name age and calorie goal. They then click submit to store the information. When that is done they click Start Tracking to begin tracking their calories.

The user go through and finds the food that the have consumed and it will display underneath the image. If the food is not listed they can click look it up to go to a site with a larger database for food.

The user then submits the values that are displayed and then when they are finished they can click see total to see their name, age, and calorie goal with their total calories submitted.

This is the final screen it shows their name goal and age (wasn’t submitted) along with the total calories that the user submitted. Under the image there is a back button that the user can click to make more entries.


Algorithms:  This is one of the first major algorithms in the application. In this algorithm when the user enters theirs name, age and calorie goal each of those values are stored into a tinyDB so that it can be stored locally on the application and called later on. This algorithms also includes a notifier and a hide keyboard function so that when the user clicks submit the keyboard disappears and a notification shows up saying that the information has been submitted.

This is our first major algorithms and abstraction. This algorithm includes 4 if/then statements that call the values and the tags stored in the FirebaseDB which is essential to the main functionality of the application. In this algorithm for each of the selected food groups there is an if/then statement that says if the tag is in the list elements then set the label to the tag and the amount of calories. When the user clicks a food item in a given category it will display the tag and the value at the bottom in a sentence and if you were to make another entry in the same food category it would display under the last entry.

This is another algorithm that is essential to the functionality of our application because all of the elements in these lists were stored in the FirebaseDB. This is a rather basic algorithm, when the screen starts it uses 4 list pickers with about 10 selections in each to make the lists that the User uses to make their selections. When the User clicks “Breakfast” the list picker will display the 10 items in the list that were coded in this segment and the same with the other meals.

This is a group of four of the same algorithms, but are essential to the functionality of the FirebaseDB and the application in general. This allows the List pickers to work and be able to call the values set up in the database. After the user picks the list pickers it will get the value of the selection in the list picker. This algorithm is what gets the values from the database so that they can be displayed on the application. If these algorithms weren’t there then the information would not be pulled from the database.


As mentioned before, this is one of our most complex algorithms and abstractions. This code uses a procedure with two parameters that allow for cleaner looking code. The procedure has two parameters one is value and the other is tag. We coded this abstraction so that whenever a tag was in the list picker elements then it would set the text to the tag and the value of the given meal group and used if then statements for each of the meal groups so they would preform the same function. This procedure allows the code in the firebaseDB got value to be only 3 blocks making it much simpler and easier to read. This also allows the application to display the amount of calories of each selection in the list on the application so that the User can enter it into the text box to store the value.

This segment of code contains another main algorithm used in the application. We started off by coding the arrangements so that it created a virtual screen. Then we needed to display the value stored in the tinyDB from earlier in which the user stored their name and their calories goal. We created two labels that joined name and calorie goal to the value stored in the tinyDB. This displays the name and age with the calorie goal on the last page. We also set a label so that it would join Total Calories with the global variable Total calories so that the User could see if they reached their calorie goal. At the end of the abstraction we included a label that would randomly select from a list that included advice about how the user should be eating. We then call this procedure so that when they click submit on the meal page that it will show all of these things on the final page. This allows the code to be much more readable and clear. There is also only one block in the ButtonSubmit which is the procedure being called making the code much simpler.


We got much of our assistance from the TAs Brian and Selina who did a great job explaining how to get the application to function while not actually doing the coding themselves. Also we had received help from Ms. Lake with the FirebaseDB because we were not sure if we were coding it right and she pointed us in the right direction and she had also sent us a Firebase tutorial. We used an additional tutorial to finally figure out how to properly code the FirebaseDB as cited below.

Point, Tutorials. “Firebase Tutorial.”, Tutorials Point, 31 Dec. 1969,

MyFoodDiary® Calorie Counting Made Easy.” MyFoodDiary,


Market Testing:

Carin Colebaugh- Liked the idea of the application, there was no bugs at this stage because the app was virtually completely finished but she suggested adding directions and information regarding serving sizes. This was a helpful suggestion and we implemented it in our application.

Fumihiro Tamada- He figured out the app pretty quickly without needing any directions and he said he liked the application and was impressed that we coded this ourselves. He liked the images and the UI set up. He suggested something to notify when the user submitted their personal information. We also included this feature in our final version of the app.