Skip to content
Simon Reinkemeier edited this page Mar 11, 2019 · 3 revisions

Welcome to the privacy-friendly-food-tracker wiki!

Introduction

This application was created to track calorie intake without sharing your eating habits with third parties. It uses the cwac-saferoom library to encrypt the database.

Activities

There are several activities in this app:

  • MainActivity: This activity contains a calendar view. Touching one of the dates opens the OverviewActivity.
  • OverviewActivity: This activity shows all entries for a day. It also calculates the total calorie consumption for a day. Touching the "Back" button takes you to the MainActivity, touching the FloatingActionButton takes you to the BaseAddFoodActivity. The calorie amount is refreshed every time the activity is shown to guarantee an always correct calorie count.
  • BaseAddFoodActivity: Contains two fragments, the AddFoodFragment and the SearchFoodFragment
    • SearchFoodFragment: This contains the search function. The search function makes requests agains the OpenFoodFacts database API using Retrofit. The search is only triggered as soon as the floating action button or the action button on the keyboard are pressed. Touching a search result switches over to the AddFoodFragment with prefilled values. When no online search is triggered, the search will only search local values, sorting the result by "most used".
    • AddFoodFragment: This fragment is used to add a new entry. When called from the SearchFoodFragment, the fields "amount" and "name" are prefilled. Internally, the product ID for the search result is also retrieved to ensure proper counting of entries. When no search result has been selected, the user can create a custom product.
  • BaseStatisticActivity: Contains a fragment for weekly as well as monthly statistics.
    • WeekStatisticFragment: Creates weekly statistics and graphs them using the GraphView library.
    • MonthStatisticFragment: Same as WeekStatisticFragment but for monthly statistics.
  • GenerateKeyActivity: Saferoom requires key generation when the App is first initialized. This activity generates a key and shows progress to the user for the sake of transparency. This activity is typically only ever called once.
  • HelpActivity: Shows a "Help" page / FAQs
  • SplashActivity: This activity is called when the app is started to show a splash screen with the app logo.
  • TutorialActivity: This is shown when the app is initialized for the first time. It can also be called again from the sidebar. It contains a quick walkthrough of the main functions.
Clone this wiki locally