Recommendation Algorithm

 Josh Miller

One of my goals for this week was to create the activity that allows the user to complete their routines. This will display the list of exercises within the selected routine, and each exercise will display its sets. From here, the user can input how much of each exercise they were able to complete and the app will take in the information and use it to adjust the difficulty and generate a new routine for the next session.

The first step here was to design the layout. I would need two separate xml files, one for the main activity, and one for the individual entry. The main layout contained a few buttons and an empty ListView while the other simply contained a TableLayout that I could dynamically add content to. 

Next, I had to create an adapter to allow the custom layout to fit into the ListView. Inside the adapter class, I would need a function that could set the title and each row of the table to the exercise's information. This turned into a bunch of functions that would call each other to set and read information in each table row, but it worked. For each exercise in the routine, it will loop through the list of sets and add a new table row with the associated information. The user is able to fill in their completed sets and check a box when it has been completed. Once the entire routine is complete, they can press "finish" and the app goes to work in the background.

Now, the app will read through all of the user's entered routine data and use it to adjust the difficulty. This is done using an algorithm that compares the maximum one rep max of a given exercise to the projected one rep max. If there is any difference, the app will use the difference to calculate a percentage to adjust the next projected one rep max by. This allows the app to improve its algorithm over time. Next, the app will generate a new routine to follow using this new projected one rep max using another algorithm to calculate the required weight and reps.