Food Log User's Manual

Food Log is an Android app to help keep track of what you eat. You make "entries" in the log every time you eat or drink. Each entry contains the date and time and (optionally) which foods you ate. You can attach notes to the entries if you require.

If you want to keep track of your calories you can enter the calories per serving for each food. Food Log will calculate the calories for each entry by looking at the calories for each food in the entry and the number of servings for the foods.

You can even enter the ingredients for each food and use the notes section to store the recipe for making the food.

How detailed you want to get is up to you. It is not required to enter calories or ingredients for foods, or even to enter foods for the entries. Obviously, some of the functions of the app will not work if don't enter the required information. For example, if you don't enter ingredients for foods you won't be able to search for entries or foods by ingredient.

The screenshots in this document were taken from an Android tablet running Android 4.4.2 (KitKat). They might be slightly different than what you see when running the app on your device but the controls should work similarly. One difference may be that this tablet has a hardware menu button whereas most newer devices don't have menu buttons. Devices without a menu button will have a menu icon on the action bar:

Menu button on action bar
Menu button on action bar.

Some devices with a hardware menu button will not have this icon. Throughout this manual, when the instructions say to press the menu button, you can press this icon if it is shown or press the hardware menu button on your device.

Credits

This app uses the Caldroid widget from github. See this link for Caldroid copyrights and licenses.

This app uses the OpenCSV library from sourceforge. See this link for the OpenCSV license.

Some icons and app store graphics were made with clip art from openclipart.org. Specifically the following images were used:
Pencil, Notebook, White plate, Restaurant

Contents

Versions

There are two versions of the Food Log app: an ad-supported version "Food Log" and a pay version without ads "Food Log - Ad Free". This manual describes both versions, since the only difference between the two is the showing of advertisements.

Though they function the same, the two apps "Food Log" and "Food Log - Ad Free" are separate apps with separate databases. That means that if you used the ad-supported version and later install the ad-free version, your data from the ad-supported version will not automatically be available to the ad-free version. You can transfer your data from "Food Log" to "Food Log - Ad Free" (or vice versa) by exporting from one app and importing from the other.

Go into the "Food Log" app's Main screen. Press the menu button and choose the "Export" option. This will write out all the data to the foodlog.csv file. Then exit out of "Food Log" and go into the "Food Log - Ad Free" app's Main screen. Press the menu button and choose the "Import" option. This will create the database from the data in the "foodlog.csv". Now the ad-free version has a copy of the same data as the ad-supported version.

After you have copied the data and verified it is there, you may want to remove the ad-supported "Food Log" app so you don't accidentally enter new data into that app.

Main Screen

When the app is launched it will take you to the main screen.

Main Screen
Main Screen.

At the top right of the action bar, the ? Help button will set this screen in Help Mode.

At the top above the buttons is a colored bar - the calorie meter. This visually indicates your calorie intake for the day. It goes from left to right and the color goes from green to yellow to red as you pass your normal and high calorie limits. Touch the bar to get the number of calories for today and the limits. The calorie meter is only shown if calorie color coding is turned on in the Settings screen.

The New Entry button lets you create a new log entry which records what foods you had and when you had them. The Calendar button shows a calendar with all your log entries.

The Foods button lets you enter new foods into the Food Log database or search for existing foods in the database. You can edit a food to add details such as the calories per serving or ingredients it contains. You can also write out food details to a report file and view it.

With the Search button you can find entries in the log based on a date range, notes, foods or ingredients. The Settings button allows you to adjust your daily calorie limits or ignore calorie limits altogether.

In the ad-supported version of Food Log, when you press one of the above buttons you will be shown an advertisement. You will only be shown one advertisement each time you run the app. Usually this will happen the first time you press one of the buttons, but not always. You can usually dismiss the advertisement by pressing the device's back button. Once you dismiss the ad, the screen for the button you pressed will be shown.

In addition to those buttons you can press the menu button (either on the screen or the menu button on the device) for more options.

Options menu on the main screen
Options menu on the main screen.

The Export CSV option writes out the entire Food Log database of entries, templates, foods and ingredients into a CSV file called "foodlog.csv" in the main storage area of your device. CSV stands for "comma separated values"; these types of files can be viewed by many programs such as Excel, Open / Libre Office, and many others. The format of the foodlog.csv file is described in the CSV Format section.

If you do export the database be aware that if you uninstall the Food Log app from your device, the "foodlog.csv" file will not be erased automatically. You must remove that yourself.

Besides viewing the database, another reason to export the database into a CSV file is to have a backup of the database which you can restore later. The Import CSV option lets you restore the database from the "foodlog.csv" file. Note that the database will be completely erased and rebuilt from the data in the CSV file, which means any additions or changes you have made will be lost.

The Merge CSV option is similar to the import function except that it does not erase the database. It is described in detail in the Merge CSV section.

The About menu option displays some information about Food Log.

The User's Manual option starts a browser to view this manual.

The Privacy Policy option starts a browser to view Food Log's privacy policy document.

Exit from the app by pressing the device's Back button from the main screen.

Entry Editor

An Entry in the log records the date and time you ate or drank along with the foods you had. Create new entries or edit existing entries with the Entry Editor. The Entry Editor screen looks like this:
Entry Editor
Entry Editor.

To change the entry's date press the button displaying the date (A). Similarly, change the entry's time by pressing button showing the time (B).

If the "Hide Time Zone" option is not set (see Settings), the time zone for the entry is shown in spinner (C) next to the time. By default, new entries will get the time zone from the device. To change the time zone press the spinner and choose a time zone from the list. When you change the time zone, the time and possibly the date will also change, to display the original date and time in the new time zone.

If you want to enter any notes about this specific entry put them in the text box (D). You can look up this entry later using words in your notes (See Search).

The calorie counter (E) is calculated automatically from the foods you enter; you cannot edit this field. If calorie color coding is turned on in the Settings screen (see Settings) the calories value is highlighted in yellow or red if the day's calories (including this entry's) are over your normal or high calorie limits, respectively.

The second part of the screen (F) is for entering the foods you had. Each row is divided into 3 sections - the name of the food or drink, the number of servings you had, and any notes you want to record for that food. These notes are different from the food's general notes that you can enter into the food editor - these notes are just for this entry. At the very right is a red "X" (G) - press that to remove the food from the entry.

If you are editing an existing entry instead of creating a brand new entry, the foods for the entry will be shown (H). You cannot change the names of these foods, you can only change the number of servings and notes, or you can delete the food.

To add a new food to the entry press the Add Food button (I). You will get new blank row where you can enter the food name, servings and notes (J).

If you want to enter a food's details like calories and ingredients you can do it directly from the Entry Editor by long-pressing the name of the food. This will take you to the Food Editor. You can also update food details by going to the Food Search screen from the Main Menu and looking up the food to edit it.

To save the changes you made to the entry and exit from the Entry Editor press the Save & Exit button (K). You can also return to the previous screen by pressing the Back button on your device. If you have made changes to the entry you will get a chance to save them.

It is possible to edit the same entry twice. For example, if you are editing an existing entry, using the long-press shortcuts you could go from the Entry Editor to the Food Editor to Search screen to Search Results screen and again to the Entry Editor. If you try to edit the same entry twice, the second Entry Editor will be put in read-only mode. In this mode you can only view the entry details, no changes are allowed.

Entry Templates

Entry templates allow you to give a name to a group of foods, along with their servings and notes, so that they can be recalled later. For example, if most days you have the same foods for breakfast, you can save those foods as a template named "Breakfast". The next time you create an entry for breakfast, you can load that template which will populate the foods, servings and notes of the entry from the saved info in the template. Then you can make any changes necessary and save the entry. So using these templates can save you time and typing.

Create a Template

To create an entry template from scratch go into the Entry Editor to create a new entry. You can do this by pressing the New Entry button from the Main screen. Enter the foods, servings and notes (both the entry notes and the per-food notes) you want to save in the template. Then press the menu button and choose the Save template option.

Entry Editor Menu
Entry Editor Menu.

You will be asked to enter a name for the template. Type in a name and press OK.

Entry Template Save Dialog
Entry Template Save Dialog.

Note that this only saves the template, not the entry. You can either discard the entry or save it too by pressing the Save & Exit button.

Also, you don't have to start with a blank entry to create an entry template. If you are viewing an existing entry that has foods you'd like to save as a template you can press the menu button in the Entry Editor screen and choose Save template.

Recall a Template

To recall a template when creating a new entry, you can press the menu button and choose the Load template option. (This option is only available when creating new entries; you cannot load a template on top of an existing entry.) You will see a list of available templates to choose from.

Load a template
Load a template

Touch the name of the template to load, or press the Back button on your device to cancel. When you choose a template, its foods, serving counts and notes will be copied into the entry. Then you can make any changes necessary and save the entry.

Deleting Templates

You can delete entry templates by going to the Entry Editor and choosing the Delete template option from the menu. You will see a list of templates along with checkboxes next to each of them.

Delete a template
Delete a template

Touch the names of the templates that you want to delete and press the DONE button. You can cancel the delete action by pressing the Back button on your device without pressing the DONE button.

Calendar

The calendar screen shows your entries in a calendar format. If you have set your daily calorie limits (see Settings) the days will be color coded according to the number of calories consumed each day - green if under your normal calorie limit, yellow if over your normal limit and under your high limit, and red if over your high limit. If you have not set any calorie limits, any day with entries are colored green. Any day without entries will be white.

Calendar screen
Calendar screen.

Pressing the gear icon (A) on the action bar brings up the Settings screen. In this screen you can adjust your calorie limits and choose whether to show time zones when displaying the entries. Adjusting the calorie limits affects how the calendar days are color coded.

You can navigate through the calendar by swiping the calendar left or right or pressing the left or right red arrows at the top (B). Touching the month or year at the top (C) will bring up a dialog that lets you jump to any month and year.

Go to month dialog
Go to month dialog.

When the device is in portrait orientation you will see two tabs at the bottom of the screen (D). With these tabs you can switch between viewing the calendar or viewing the entries for the selected day. You can change the view by touching a tab's name or swiping left or right on the tab strip at the bottom of the screen.

Select a day by touching it in the calendar. Its color will change to light blue to indicate it is the selected date. The entries for that date will show in the ENTRIES tab when in portrait orientation or in the right part of the screen when in landscape orientation.

Entries for a single day
Entries for a single day.
Entries for a single day (landscape mode)
Entries for a single day in landscape mode.

If you have set calorie limits, the borders of the entry list section will be colored green, yellow or red according to the number of calories consumed for the selected day. You can view or adjust your calorie limits by pressing the gear icon on the action bar at the top.

The times for the entries are shown (A). (The time zone is only shown if the "Hide Time Zone" option in the Settings screen is not set.) Below the times are any notes for the entries (if any) and the foods for the entries (B). If calorie limits are set, the calories for the entries are also shown. To view or edit an entry touch the entry's time (A). That will take you to the Entry Editor.

To create a new entry for the selected date press the Add Entry button at the bottom (C). That will take you to the Entry Editor with the date set to the selected date and the time set to noon. You can adjust the time within the editor. Long-pressing the Add Entry button will create a new entry for the current time and date, regardless of the date selected in the calendar. This is a shortcut to create a new entry, so you don't have to return to the Main screen and use the New Entry button.

To delete an entry press the red "X" at the right (D).

If you touch a date in the calendar without any entries (a white colored square), Food Log assumes you want to create a new entry for that date and takes you directly to the Entry Editor.

Pressing the menu button offers some more functions.

Menu items in Calendar screen
Menu items in the Calendar screen.

The Bulk Delete option lets you delete all old entries prior to a certain date. To use it, select the date prior to which the entries should be deleted, then press the menu button and choose the Bulk Delete option. You will be asked for confirmation before deleting.

The Average option can give an average daily calorie intake for the selected days. The Generate Report option can create an HTML report of entries for the selected days. Both of these functions require you to select a date range on which to operate. To select a range, select the beginning date by pressing on a date normally, then select the ending date by long-pressing it. The ending date may be the same as the beginning date, to select a range of 1 day. The beginning and ending dates and all dates in between will be highlighted.

Once a date range is selected, choose the Average menu option to compute the average daily calorie intake for the selected days.

Choose the Generate Report menu option after picking a date range to create a report in HTML for all the entries in the selected dates. Each entry's time, foods, servings and notes are shown for those days. If calorie color coding is turned on in the settings, each entry's calorie count is also shown. In addition, if you are not viewing search results in the calendar, the total calories for each day is reported as well. Each time a new report is generated it overwrites any previous report.

Once the report is generated, if you have an app installed that can view HTML files it will be run to show the report. Some apps such as Chrome will allow you to do things like email or print the report.

Report example
Report example.

You can also view the report by pressing the menu button and choosing the View Report menu item. If there is no HTML viewer installed on your device Food Log will put the report in the device's main storage area, under the Food Log app's files folder. Usually this is in /Android/data/com.coderys.foodlog/files, in a file called "report.html".

Note that the old method of generating a report - by long pressing on a date and entering the number of days to report on - no longer works. You must select a date range and use the Generate Report menu option.

If you have selected a date range but want to cancel it, simply press another date. The range is canceled and the pressed date becomes the currently selected date.

Foods

The Foods screen allows you to add new foods to the Food Log database, search the database for existing foods, or view the last generated food report.

Foods menu
Foods screen options.

The Search Foods button will bring up the Food Search screen. The Add Food button will start the Food Editor to create a new food in the database.

The View Foods Report button lets you view the last generated foods report. Pressing it will start an HTML viewer app to display the report. See the Food Editor section to learn how to create a foods report.

Food Search

In the food search screen you can look up the foods in the Food Log database by the food's name, an ingredient name that is contained in the food, or a word or phrase in the notes attached to a food or ingredient.

Food search screen
Food search screen.

Press the (A) radio button to look up foods by name, or press the (B) radio button to look up foods by ingredient name. Then enter the food or ingredient name in the text field (D). The name can be a whole name or part of a name. Case doesn't matter as all foods and ingredients are converted internally to lower case.

To search by notes attached to the food or ingredient press the (C) radio button. Then enter the word or phrase to search for in the text field (D). Use lower case for the words to search for and use upper case for operators like OR: e.g. bake OR fry. See the Search by Notes section for more examples of the kinds of searches you can do.

When you have entered the search terms into text field (D) press the search button (E). The search results will show up below the text field.

Food search screen with results
Food search screen with results.

Touching the name of a food from the results will bring up that food in the Food Editor. Note that you must touch the name of food, otherwise the touch might not register. This is especially true when the food contains a long note attached to it.

To delete a food touch the red "X" at the upper right of the food. If a food you want to delete is used in any entries, you are not allowed to delete it, you will just get an informational dialog saying how many entries have that food in them.

If you want to see the entries that have a food in them, touch the search icon (magnifying glass) at the lower right of that food's listing. That takes you to the Search screen with that food already in the foods list. Just choose how you want to view the results (as a list or in the calendar) and press the the Search button.

Go back to the Foods screen by pressing the Back button on your device.

Food Editor

In the Food Editor you can create new foods or edit the details of existing foods.

Food editor
Food editor.

The Food Editor works much like the Entry Editor. At the top is a text field for the name of the food (A). You don't need to capitalize names of foods or ingredients since all food and ingredient names are converted to lower case in the database. If you enter the name of a food that is already in the database you will be given the option to edit that food.

If you are editing an existing food and you did not get to the Food Editor by long-pressing a food in the Entry Editor, you can change the name of the food if necessary. Enter the new name in the text field (A). All entries that have this food will automatically use the new name once you save this food to the database.

Long-pressing the name of a food will take you to the Search screen where you can look for entries that contain that food. The "Search by foods / ingredients" checkbox will be selected and the food name will be populated. Just pick how you want to show the search results and press the Search button.

Enter any notes for the food in the text field (B). Notes are optional but if you enter notes they can be used to look up the food or entries that have this food. Enter the calories per serving in the text field (C). Calories are also optional - if you do not count calories then you can leave this as 0.

The second part of the screen is for the ingredients contained in the food. Each row is divided into two sections, the ingredient name (D) and any notes about how this ingredient is used in this food (E). You do not have to enter ingredients for foods or enter notes for ingredients, but if you do they can be used to look up the food or entries that have this ingredient.

At the right of each row is a red "X" (F) - press this to remove the ingredient from this food. Press the Add Ingredient button (G) to add a new ingredient row to this food.

When editing an existing food, you cannot edit the ingredient name field of any ingredients already associated with that food (unless you are renaming an ingredient, see below). You can change the notes for those ingredients or you can remove them by pressing the red "X". You can add new ingredients to existing foods too.

To save your changes and return to the previous screen press the Save & Exit button (H). You can also return to the previous screen by pressing the Back button on your device. If you have made changes you will get a chance to save them or abandon them.

On the action bar at the top, to the right is the Write To Report icon (I). If there is no room to display this icon on your device it will be in the menu - just press the menu button on your device. Press the Write To Report menu option to write this food's details to a report file. The name, calories, ingredients and any notes will be written to the report in HTML format.

If there is already a foods report, you will be asked if you want to add this food's details to the existing report or overwrite that report. Once written, Food Log will run an HTML viewer app (like a web browser) to view the report. Another way to view the report is from the Foods screen's View Foods Report button.

If there is no HTML viewer installed on your device, Food Log will put the report in the device's main storage area, under the Food Log app's files folder. Usually this is in /Android/data/com.coderys.foodlog/files, in a file called "foods.html".

Long-pressing an ingredient name will show you a menu with some actions you can perform on the ingredient: renaming, searching or pasting. Choosing the Rename option will let you rename an ingredient, for example to fix a typo in an ingredient name. This takes effect in all foods that use the selected ingredient, not just the one you are currently editing. You will see a dialog where you can type in the new name of the ingredient.

Ingredient rename dialog
Ingredient rename dialog.

When you enter the new name and press Rename, the foods in the database will be updated with the new name. You don't need to save the food for the change to take effect.

Choosing the Search Entries option from the menu will take you to the Search screen where you can look up entries that have foods that contain this ingredient. The ingredient name will be populated, you just need to select how to view the results and press the Search button.

Choosing the Search Foods option from the menu will take you to the Food Search screen where you can look up foods that contain this ingredient. The results of the search will be displayed. Press any of the displayed food names to edit them or press the Back button on your device to return to the Food Editor.

In certain conditions, you may see another option Paste. This option is only available when you long-press on a new ingredient field for the food and there is text in the system clipboard. Choosing this option will paste the text in the clipboard into the ingredient field.

It is possible to edit the same food twice. For example, if you are editing an existing food, using the long-press shortcuts you could go from the Food Editor to the Search screen to Search Results screen to Entry Editor and again to the Food Editor. If you try to edit the same food twice, the second Food Editor will be put in read-only mode. In this mode you can only view the food details, no changes are allowed.

Search

The search screen allows you to search for entries by date, notes, foods or ingredients.

Search screen
Search screen.

Search by Date Range

To search by dates press the "Search by date range" checkbox (A), then press the Start Date button (B). This will bring up a window to select a date.

Selecting a date
Selecting a date.

After selecting the date press the Set button; both the starting and ending dates will be set to the selected date. If you want to change the ending date press the lower button (C) and select another date. Food Log will search for all entries after the starting date's 12AM up to the ending date's 11:59PM when you press the Search button.

Search by Notes

To search by notes press the (D) checkbox and enter the word or phrase for which to search in the text field below (E). Use lower case for the words you want to search for and upper case for operators like OR (see examples below). All the notes will be searched - entry notes, food notes and ingredient notes.

As an example of how searching by notes works, let's look at an entry and its associated foods.

Example Entry
Example Entry.
First Example Food
First Example Food.
Second Example Food
Second Example Food.

The notes of this entry and the foods will be used to illustrate the various ways you can search for notes.

The simplest search you can do is to just enter one word. Each of the notes sections of the entry and the foods used in the entry will be searched for that word. Example: lunch will match for this entry since the entry's notes begins with the word "Lunch" (case does not matter).

If you enter multiple words, each word must appear in the same notes section. For example, bob cafeteria will match this entry because both words appear in the entry's notes section. The words lunch butter will not match this entry because the word "Lunch" appears in the entry's notes section and the word "butter" appears in different notes sections - in the entry notes for the Bread Roll and in the notes for the food Tomato Soup.

It is possible to search for words beginning with a prefix without giving a specific word by putting a "*" at the end of the search term. Example: this entry will match a search for trans* because the word "translucent" appears in the Tomato Soup food's notes. You can use a prefix anywhere you would use a full word.

You can search for a phrase by putting words inside double quotes. This differs from just entering multiple words by requiring the words occur in order and without any intervening words in between them. Example: "bob cafeteria" would not match this entry because though both words appear in the entry's notes section there are more words between them. The phrase "golden dinner" does match this entry because those two words occur in order in the Bread Roll food's notes.

You can combine most of the search types above with the set operators AND, OR and NOT. The AND operator is implicit when you enter multiple search terms, you don't need to write it out. Example: in the search terms lunch carol bob it is implied that the app should search for notes containing "lunch" AND "carol" AND "bob".

The OR operator works as you would expect - it searches the notes sections for one of many possibilities. You need to write out the OR operator explicitly, in uppercase. For example: breakfast OR lunch will match this entry because though it does not have the word "breakfast" in any of its notes sections it does have "Lunch". Another example: grate OR chop* will not select this entry because the word "grate" nor any word beginning with "chop" appears in any notes section.

The NOT operator is used to select notes that contain some words but not others. It is written as a "-" preceding a word or prefix. (It does not work on phrases.) Example: -bob carol will search for notes containing "carol" but not "bob". This search will match this entry because of the entry's notes for the food Tomato Soup - "had half of Carol's too". Another example: bob -carol will not match this entry because there are no notes containing "bob" without "carol". Incidentally, you cannot do a search for only negative terms; a search for -breakfast -dinner is illegal and will not match any entries. You must supply a word, prefix or phrase to search for along with the negative term(s): "at cafeteria" -breakfast -lunch (this is legal but will not select this entry because the note containing the phrase "at cafeteria" also contains "Lunch").

It is possible to combine operators too. The precedence of operators is NOT first, then OR then AND. For example: -grate chop OR dice onion searches for notes not containing the word "grate", and containing either of the words "chop" or "dice", and with the word "onion" (which matches this entry's Tomato Soup's notes).

Search by Foods or Ingredients

To search by food or ingredient press the (F) checkbox and then press the the Add Food/Ingrd. button (G) to add a text field where you can enter the name of a food or ingredient. Unlike in the food search screen, here the name must be the full name, it cannot be a partial name. Case does not matter.

If you enter more than one food / ingredient to search for, each one can match either a food name or an ingredient name. This is different from versions of Food Log prior to 1.1 where all had to match either foods or ingredients.

You can combine search options. For example you could search for entries within a date range containing a certain food.

You can view the search results in the calendar or as a list. Choose how you want the results displayed by clicking the (H) or (I) radio buttons. Then press the Search button at the bottom to start your search and see the results.

Search Results in Calendar

The calendar showing search results works basically the same as when showing all entries (see Calendar).

Showing search results in calendar
Showing search results in calendar.

When showing search results the very top will show what the search criteria were, how many matches were found and the date range in which the matches occurred (A).

Dates with matching entries are colored violet. Press on a date to see the list of matching entries for that date. Touch an entry's time (B) to view or edit the entry's details in the Entry Editor. Delete an entry by touching the red "X" (C) at the right of the entry.

When displaying search results in the calendar, calorie counts for days and the New Entry button are not displayed. Also, dates outside the matching date range are not selectable (shown grayed out (D)).

When the device is in portrait orientation the calendar and the entries sections are displayed in different tabs, just like when showing all entries. Switch between the tabs by touching the CALENDAR or ENTRIES tab name, or swiping left or right on the tab strip at the bottom of the screen.

Search Results in List

The other way to show search results is in a list.

Showing search results in a list
Showing search results in a list.

The top line (A) shows what the search criteria were and the second line shows how many matches were found. Touch the entry's time (B) to view or edit the entry's details in the Entry Editor. Delete an entry by touching the red "X" at the right of the entry (C).

Settings

In the settings screen you can set your calorie limits and set whether to display time zones for entries.

Settings
Settings.

The calorie limits control the color coding of the days in the calendar, the displaying of the calorie meter and highlighting calories in the Entry Editor. They also control things like whether calorie counts are shown for entry lists and reports. Both limits are initially set to 0, and you can leave them like that if you do not want to use Food Log's calorie color coding features.

If you do set them, in the calendar the days in which you consumed less than your normal calorie limit will be colored green, days with a calorie count between your normal limit and your high limit are colored yellow, and days over your high limit are colored red. The same color scheme is used for the main screen's calorie meter. The Entry Editor will highlight the calories field in yellow or red if you are over your limits for that day.

Alternatively, you can set only the "Normal Calorie Limit" and leave the "High Calorie Limit" at 0. In that case the calendar will show days over the normal calorie limit in yellow and ones under the limit in green. Similarly, the main screen's calorie meter and the Entry Editor's calorie highlighting will not use the red color.

Touch the "Normal Calorie Limit" or "High Calorie Limit" sections to set each one respectively.

The "Hide Time Zone" setting lets you view entries without the time zone information. When this option is checked you will not see the time zone in the Entry Editor, in the entry lists in the Calendar, in Search Results or in reports. Any new entries created while this option is turned on will set those entries' time zones to the device's time zone. Old entries' time zones are not changed.

Help Mode

In almost every Food Log screen, near the top right of the action bar is the ? Help button. This may show as just a ? on smaller devices. Pressing this will make the current screen go into Help Mode. In this mode, pressing any of the on-screen controls like buttons, text entry fields, checkboxes, etc. will show a message describing what that control does. Here is a message describing the New Entry button of the Main screen.

Help Mode window for New Entry button
Help Mode window for New Entry button.

You have the option to get more information about that screen by pressing the More Help... button. That will open a browser to this web page and jump to the section describing the screen.

To get out of Help Mode and go back to using the app normally press the ? button again.

Merge CSV

The Merge CSV feature will read Food Log data from a CSV file into the database. Whereas the Import CSV feature will erase and rebuild database from the CSV data, the Merge CSV feature will add to the database any entries, templates and foods that are in the CSV data but not in the database. It will also go through the entries, templates and foods from the CSV data and make sure they match the corresponding entries and foods in the database. If a difference is found, you can choose whether to keep the database's version or the CSV file's version.

One use for the Merge CSV feature is if you have Food Log installed on multiple devices. If you enter new entries and/or foods into one device and you want those entries and foods added to a second device's Food Log database, the Merge CSV feature will help you do that. On the first device you can use the Export CSV feature to dump out the database to the "foodlog.csv" file. Then you will need to somehow transfer that file to the second device. This can be done by various methods such as Android Beam, apps like SuperBeam, or transferring via a cloud service like Dropbox, or other means.

Let's say you used the SuperBeam app to transfer the file, so the "foodlog.csv" file from the first device is transferred to the second device and placed in the "SuperBeam" folder. Then on the second device you start Food Log and from the main screen's options menu select Merge CSV. You will be shown a file chooser which you can use to navigate to the "SuperBeam" folder and select the "foodlog.csv" file. The CSV file can be from any folder on your device that you can access and need not be called "foodlog.csv".

File chooser to select the CSV file.
File chooser to select the CSV file..

Once a file has been selected, Food Log will compare the data in the CSV file to its own database. Any foods, entries and templates not found in the database will be added. If there are differences in the entry, template or food data between the CSV file and the database, all the differences found will be shown as list of "conflicts". For each item in the conflict list you can choose whether to keep the CSV file's version or the database's version of the data (or both or neither in the case of entries).

Merge entry conflict
Merge entry conflict.

The above screenshot shows the first conflict found out of a total of three conflicts. It shows that the entry on Feb 10, 2016 at 12:30 is different between the CSV file and the database. The two entries are shown in a list, the CSV file's entry at the top, then the database's entry. You can see that the CSV file's entry has an extra food associated with that entry.

You can also see that the "Keep this one" checkbox has been selected on both entries. By default, for entry conflicts the "Keep..." checkbox is checked for both the CSV item and the database item(s); for food conflicts and template conflicts only the CSV file's "Keep..." checkbox is checked. Food Log allows multiple entries for the same time, so if you want you can keep both the CSV file's and database's entries in the database. But in this case you probably want to keep only the CSV file's version. To toggle the "Keep this one" checkbox for an item simply touch the item. Note that for an entry conflict, if none of the "Keep this one" checkboxes is checked the existing entry or entries in the database will be deleted.

The Next button and Prev button (disabled for the first item in the conflict list) on the bottom of the screen let you go to the next or previous item in the conflict list. In this example, pressing the Next button goes to the second conflict which is a food conflict.

Merge food conflict
Merge food conflict.

As mentioned, the default for food conflicts is to check the "Keep..." checkbox only for the CSV file's data. Toggle the "Keep..." checkbox for an item by touching that item. Unlike entry conflicts, you must keep at least one of the foods, so if you decide to keep the database's version of the data, the CSV item is automatically unchecked (and vice versa).

If there are any conflicts in the entry templates they will be shown after any entry and food conflicts. They are similar to entry conflicts except you must choose to keep either the CSV version or database version - you cannot keep both (unlike entries).

When you reach the end of the conflict list the "Next" button is relabeled "Done". Pressing that button will update the database with the changes you have selected - the items with the "Keep..." checkbox selected will be added to the database, the other items will be discarded. When the merge is finished just press the Back button on your device to return to the previous screen.

If you have conflicts during a merge but want to abort the merge process you can press the Back button on your device when the conflict list is shown. The database will not be changed when you abort a merge operation.

Note that because the Merge CSV feature checks that the entries, templates and foods match, it is much slower than simply importing the data with the Import CSV option. The more data contained in the CSV file the slower the merge process will be.

Merge Limitations

There are a couple of cases that the Merge CSV function does not handle well. The merge process was created to add missing entries and foods to the existing database. It was not designed to make two databases identical. As a result, when entries are moved to a different time or foods renamed, the merge process will result in double entries or foods.

For example, let's say two devices A and B have identical Food Log databases. In those databases there is an entry for Jan 1, 2017 3:00AM. When looking at entries on device A you notice that entry and realize that the time should be 3:00PM not AM, so you edit the entry and change the time. Now if you were to export device A's database, transfer it to device B and merge it with B's database, you will end up with two entries, the original one at 3:00AM and a new one at 3:00PM.

A similar thing happens when foods are renamed. If on device A you renamed the food "lemon cookies" to "carr's lemon cookies" and you again merge device A's database into device B's database, you will end up with both "lemon cookies" and "carr's lemon cookies" in the database on device B. The merge process will also show conflicts in the entries that use the renamed food.

One way to mitigate the problem is when you move an entry or rename a food, add something like "moved from 3:00AM to 3:00PM" or "renamed from lemon cookies" to the Notes section of the food or entry. After a merge is done, you can go to the Search screen and search by notes for "moved" or "renamed". You can see a list of entries or foods that have been moved or renamed and you can go and delete the original entries or foods.

Importing or Merging From Other Apps

Some apps that work with files such as Dropbox, FX file explorer, etc. are able to pass a CSV file directly to Food Log to import or merge data. The Food Log app will treat a CSV file passed to it as a Food Log database and is able to read the data from it (assuming it really is a Food Log CSV file and not some other CSV file).

In those apps you typically need to select the CSV file, then open a menu of the possible actions to perform on the file, maybe by pressing the menu button, or long pressing the CSV file. In the list of actions there may be an option like "Open with". When this is selected you will see a list of apps that can take a CSV file, and Food Log should be listed among those apps.

Sending a CSV file to Food Log through FX
Sending a CSV file to Food Log through FX

Selecting Food Log will send the CSV file to Food Log, and you will be asked whether you want to import the CSV file (which overwrites the existing database) or merge it (which adds to the existing database).

Not all apps can send a CSV file to Food Log, and the exact method to get an app to send a file will depend on the app.

CSV Format

Food Log can export its database to a CSV format file. You can access this option from the main screen by pressing your device's menu button or pressing the menu icon on the action bar. The CSV file will be named "foodlog.csv" in your main files directory. This section of the manual describes the format that Food Log uses to write its database to the CSV file.

The general format of CSV files are described in many places on the web such as this article from Wikipedia. This is a description of the Food Log data that is in the exported file.

Here is some sample data from a Food Log CSV file:

"FormatVersion","5.3"
"Created","5/20/19 7:10:06 PM Mountain Daylight Time"
""
"Food","Calories","AutoAdd","Notes","Ingredient","Ingrd. Notes"
"bacon","400","no","a serving is 4 strips"
""
"banana avocado pudding","250","no","From www.vibrantvegan.com
Place ingredients in blender, blend until smooth.  Pour into bowl or cup."
"banana avocado pudding","","","","avocado","one-half"
"banana avocado pudding","","","","bananas","1-2"
"banana avocado pudding","","","","cocoa","1-2 teaspoons (optional)"
"banana avocado pudding","","","","vanilla","half teaspoon (optional)"
""
"breadsticks","0","yes",
""
""
"Date Time","Time zone","Notes","Calories","Food","Servings","Food Notes"
"1/31/16 12:00 PM","America/Denver","","0"
""
"2/1/16 9:00 AM","America/Denver","","720"
"2/1/16 9:00 AM","","","","bacon","1.0",""
"2/1/16 9:00 AM","","","","eggs","1.0",""
"2/1/16 9:00 AM","","","","toast","1.0",""
"2/1/16 9:00 AM","","","","orange juice","1.0",""
""
""
"Name","Notes","Food","Servings","Food Notes"
"Breakfast",""
"Breakfast","","wheaties","1.0",""
"Breakfast","","milk","1.0","with cereal"
"Breakfast","","sausages","2.0",""
""
"Dinner","hearty dinner"
"Dinner","","steak","1.5",""
"Dinner","","baked potatoes","2.0",""
"Dinner","","salad","1.0",""
""

At the beginning of the file is the FormatVersion line which assigns a number to the format of the CSV file and the database. Versions of Food Log prior to 1.1 did not have this line.

Following that is the creation date and time of the CSV file.

After that comes a blank line (empty quotes "") and then the food section. All the foods in Food Log's database will be listed in this section in alphabetical order. The first line gives the headers for each column of the food section. The columns are mostly self-explanatory except AutoAdd - this will be "yes" if this food was added to the database automatically and has not been modified since it was added. This happens when you add a food to an entry that is not already in the database. If you edit a food that was automatically added, for example to set the calories per serving or add ingredients and save it, it is no longer considered to be automatically added and the AutoAdd column will be "no". (Food Log versions prior to 1.1 did not have the AutoAdd column in the CSV file.)

For each food, the first line of data gives only the food name, calories, auto-add and notes values. If ingredients were entered into the database for this food then they will be listed in subsequent lines, giving the food name, ingredient name and ingredient notes (the calories, auto-add and notes columns will be empty for these lines). The end of the food's data is indicated by a blank line.

The end of the food section is indicated with another blank line.

Then the Entries section begins. All Entries in the database will be listed here in chronological order. The first line of this section gives the column headers. Then, for each entry the first line of data gives the date + time, time zone, entry notes and the total calories for the entry. If the entry has foods they are listed in subsequent lines giving the date + time, food name, number of servings and food notes (the time zone, entry notes and calories columns are empty in these lines). A blank line signals the end of data for that entry. The end of the entries section is marked by a blank line.

The next section contains entry templates. The first line gives the column headers. Then comes the templates' data. The first line of each template contains the name of the template and any entry notes. Then there is a line for each food in the template. These lines contain the name of the template, a blank field, the name of the food, the number of servings, and any notes associated with the food. The end of the template is marked by a blank line. This section continues to the end of the file.

Contact Info

If you have questions or comments about Food Log please send email to coderys@coderys.com. You can also leave a rating with your comment or question in the Google Play page for Food Log or the page for Food Log - Ad Free.


© Yasantha Samarasekera 2019
$Id: bd0c07f9bfc3aa9958efa2c22fa9e6b72e5f6046 2019-05-22 18:33:04 -0600 $