Skip to content

geckoflume/FoodIST

Repository files navigation

FoodIST icon

FoodIST: Finding food on campus

Android CI

Android application project for Mobile and Ubiquitous Computing class @ Instituto Superior Técnico, Lisbon, Portugal.

Meant to be used with the FoodIST REST Server, it provides the ability to locate cafeterias, crowdsource cafeteria menus, dishes pictures and queue wait times.

More information: https://fenix.tecnico.ulisboa.pt/disciplinas/CMov4/2019-2020/2-semestre

Group 23

Features

  • List and map of all dining options (cafeterias, canteens and bars) of IST
  • Filter cafeterias by campus
  • Campus auto-selection based on device location
  • Cafeteria details: name, opening hours, map, estimated walk time and itinerary
  • Ability to add, remove dishes and to fetch menus from the server
  • Ability to add pictures to dishes (compressed before being sent)
  • User status selection and cafeterias/opening times displayed accordingly
  • Dark theme compatible
  • Localization in English, French and Portuguese, Google translations for user-provided data
  • Dual LRU cache system, in ram and on disk with preload if the device gets connected to wifi
  • Dish, cafeteria sharing

TODO

Specifications

This application is built around the MVVM (Model View View-Model) design pattern, using Room, a DAO with LiveData and ViewModels.

Static cafeteria data and opening times are stored in an SQLite database, populated from JSON arrays 1 and 2 (see Generate opening_hours.json).

The architecture is built around the Jetpack components collection in Java, to introduce best Android practices (such as AndroidX, DataBinding, LiveData, Fragments...) and the layouts are designed with the help of Google's Material Design components.

The multi-threading is managed by java.util.concurrent Executors, to support future Android versions (see Android AsyncTask API deprecating in Android 11).

Local database specification

Database relationship diagram

Prerequisites

  • Android API Level >=v16
  • Android Build Tools >=v29

How to build

This project uses the Gradle build system.
In order to benefit from Google Maps services (itineraries, times) and Google Translate, please set an API key (with Directions API, Maps SDK for Android and Cloud Translation API enabled) in debug/res/values/google_cloud_api.xml or release/res/values/google_cloud_api.xml by replacing the google_cloud_key string:

<string name="google_cloud_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>

To build this app, use the gradlew build command or use "Import Project" in Android Studio.

Generate opening_hours.json

By default, the opening times and cafeteria locations are the following:

Campus Name Geo Coordinates Hours
Alameda Central Bar 38.736606, -9.139532 9:00-17:00
Alameda Civil Bar 38.736988, -9.139955 9:00-17:00
Alameda Civil Cafeteria 38.737650, -9.140384 12:00-15:00
Alameda Sena Pastry Shop 38.737677, -9.138672 8:00-19:00
Alameda Mechy Bar 38.737247, -9.137434 9:00-17:00
Alameda AEIST Bar 38.736542, -9.137226 9:00-17:00
Alameda AEIST Esplanade 38.736318, -9.137820 9:00-17:00
Alameda Chemy Bar 38.736240, -9.138302 9:00-17:00
Alameda SAS Cafeteria 38.736571, -9.137036 9:00-21:00
Alameda Math Cafeteria 38.735508, -9.139645 13:30-15:00 for Students and the Public 12:00-15:00 for Professors, Researchers, and Staff
Alameda Complex Bar 38.736050, -9.140156 9:00-12:00, 14:00-17:00 for Students and the Public 9:00-17:00 for Professors, Researchers, and Staff
Taguspark Tagus Cafeteria 38.737802, -9.303223 12:00-15:00
Taguspark Red Bar 38.736546, -9.302207 8:00-22:00
Taguspark Green Bar 38.738004, -9.303058 7:00-19:00
CTN CTN Cafeteria 38.812522, -9.093773 12:00-14:00
CTN CTN Bar 38.812522, -9.093773 8:30-12:00, 15:30-16:30

To quickly generate a new JSON file containing different hours, you can use the generate_openingtimes.sh script, which provides a basic yet useful assistant to help you do that painful task. Syntax :

./generate_openingtimes.sh

Note: this script requires jq to run.

Valuable resources: