Starter Project

The problem

You have been asked to build a simple system to collect data for a fitness challenge. Participants who sign up for the challenge will be given an identifying number and a wearable device that will record the number of steps that they take in a day. At the end of each day participants in the challenge will use an app to report the number of steps they took that day.

The system will consist of a database, a Spring Boot application, and an Android application.

The Android application will have two activities. The first activity will prompt the user to enter their participant number and the number of steps they took that day. After the user clicks the button to submit this information the app will display a second activity that displays a list of the participant number and step count for every user who reported data for the current day.

Starter code and helpful hints

Start by clicking the Starter Project button above to download an archive containing the NetBeans project for the Spring Boot application. The database we will use for this project is named "fitness": create a new, empty database with that name in the MySQL workbench and then import the database files from the database folder inside the project folder.

When a user sends you data for their day you should use the following SQL code to insert a new entry into the steps table:

insert into steps(day,participant,steps) values (curdate(),?,?)

To fetch all of the data that participants have provided for the current day you should use the SQL code

select * from steps where day=curdate() order by steps desc

To create the second activity for your Android app right-click on the package that contains the Java code for the first activity and select the option New/Activity/Empty Views Activity.

As always, don't forget to add the necessary library dependencies in the Gradle build file and permissions in the manifest file. If you have forgotten how to do this, consult the lecture notes for the Android quiz example.