MP2: Restaurant Preferences

Learning Objectives

MP2 is a step forward from MP1. Rather than making small changes, you'll be guided through larger additions that mirror code that we've provided, as you work to add an entirely new feature to your app.

Specifically, after completing MP2 you should be able to add new features and capabilities to an existing Android app by mimicking existing code. You'll load and parse a new data set, provide it to the client, add a new screen to eventually display that information, and write an algorithm to identify relationships between restaurants. But don't worry! We'll guide you every step of the way.


MP3 has two deadlines. We provide 10 points for getting started on the MP promptly and earning a certain number of points before the early deadline. The remainder of the MP is a week later.

For MP2 the deadlines are:

  • Early Deadline: Sunday 11/14/2021 at 11:59PM Central Time
  • Full Deadline: Friday 11/19/2021 11:59PM Central Time—note that this is a bit earlier than usual due to Fall Break.

Objectives, Testing, and Grading

To obtain the MP2 test suites:

  • If you are using Kotlin, download the MP2 tests and move the file to the app/src/test/kotlin/edu/illinois/cs/cs124/ay2021/mp/ directory in your machine project.
  • If you are using Java, download the MP2 tests and move the file to the app/src/test/java/edu/illinois/cs/cs124/ay2021/mp/ directory in your machine project.

Both Java and Kotlin will also need to obtain the preferences CSV data file and move the file to the app/src/main/resources/ directory in your machine project.

Next, you'll want to reconfigure grade.yaml in the root directory of your project to request that we grade Checkpoint 2.

Completing MP2 requires writing a bit more code than MP1, and we'll expect you to work more independently than you did in the past. While MP1 was primarily about fixing problems, MP2 will have you adding new features and augmenting your project in ways that reflect the code we've provided. As always, you will spend much more time understanding what the problem is and identifying the code you need to modify than you will actually implementing your solution.


MP2 is broken into four steps that begin to add a restaurant preferences feature to your app. Each is covered in a separate lesson.

  1. First, you'll parse preferences.csv to JSON.
  2. Next, you'll add the client-server code to provide that data to your app.
  3. At that point we'll create a new activity that allows us to display details about a specific restaurant.
  4. And lastly, we'll develop an algorithm for analyzing the restaurant preferences information to identify relationships between restaurants.

Completing MP2 requires creating several new methods, adding several new data models, and creating a new Android activity. We'll walk through all of these changes in the daily lessons.


We have provided six test cases to guide your development.

testLoadPreferences is a unit test that tests your ability to load and parse the preferences CSV file. testPreferencesRoute (unit) and testClientGetPreferences (integration) together test your server and client and how they exchange preferences data. testRestaurantView and testOnClickLaunch test your new restaurant view activity, and testRelatedRestaurants tests your algorithm for identifying restaurant relationships. You should start by completing the unit tests. The lessons will proceed through the test suites in the order that we recommend you complete them in, which is also the order that they appear in the test suite.


Grading for MP2 is broken down as follows:

  • 10 points for no checkstyle (Java) or detekt (Kotlin) violations
  • 20 points for testLoadPreferences
  • 10 points for testPreferencesRoute
  • 10 points for testClientGetPreferences
  • 10 points for testRestaurantView
  • 10 points for testOnClickLaunch
  • 20 points for testRelatedRestaurants
  • 10 points for earning at least 40 points by the early deadline

You can estimate your grade at any time by using the Grade task available in Android Studio. This is an estimate, not an official score.


You submit MP2 by pushing to GitHub, in the same way that you did for MP0 and MP1. However, make sure that you have configured grade.yaml before pushing. We grade the checkpoint you have configured in grade.yaml. So make sure that is set up to grade MP2 once you are ready.


Please review the CS 124 policies on collaboration.

All submitted code will be checked for cheating. Cheaters will receive stiff penalties. Hard-working students who are struggling honestly for their grade demand it.


You can view your official MP2 scores below.