Kotlin
Java

MP1: Restaurant List View

Learning Objectives

MP1 is intended to get you up and running with the machine project and provide practice completing several small programming tasks using Android. Specifically, after completing MP1 you should be able to:

  1. Find your way around an Android project
  2. Understand the different parts of our MP app and how they work together
  3. Engage in test-driven development
  4. Complete several small programming tasks based on a specification

Deadlines

All remaining MP checkpoints have 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 due a week later.

For MP1 the deadlines are:

  • Early Deadline: Sunday 10/31/2021 at 11:59PM Central Time
  • Full Deadline: Sunday 11/7/2021 11:59PM Central Time—note that this is the first day of daylight savings time, so make sure to set your clocks back!

Objectives, Testing, and Grading

To obtain the MP1 test suites:

  • If you are using Kotlin, download the MP1 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 MP1 tests and move the file to the app/src/test/java/edu/illinois/cs/cs124/ay2021/mp/ 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 1.

To pass the test cases and complete MP1, you need to fix a few problems with the code that we provided. This does not require writing a lot of code! 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.

Objectives

When you run the starter code you should notice three problems:

  1. The list of restaurants is not sorted
  2. Only the restaurant names are displayed
  3. The search input has no effect

Solving these requires modifications to the Restaurant model, the code in MainActivity, and the item_restaurant.xml layout fragment. We'll walk through all of these changes in the daily lessons. More specifically:

  1. The restaurant comparator should sort restaurants by name.
  2. The restaurant filter should filter the passed list of restaurants. If the passed string exactly matches on of the restaurant cuisines, you should return all restaurants with that cuisine. Otherwise you should return all restaurants where the name or cuisine contains the search value.
  3. The list of courses shown should display both the name and the cuisine.
  • Changes to the text in the search view should cause the list of visible restaurants to change appropriately.

Testing

We have provided four test cases to guide your development. Two—testRestaurantCompareByName and testRestaurantSearch—are unit tests that test functionality that you need to add to the Summary model. The second two—testRestaurantListView and testRestaurantSearchFunction—are end-to-end or integration tests that test the functionality you need to add to the Android view. 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.

Grading

Grading for MP1 is broken down as follows:

  • 10 points for no checkstyle (Java) or detekt (Kotlin) violations
  • 20 points for testRestaurantCompareByName
  • 20 points for testRestaurantSearch
  • 20 points for testRestaurantListView
  • 20 points for testRestaurantSearchFunction
  • 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.

Submitting

You submit MP1 by pushing to GitHub, in the same way that you did for MP0. 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 MP1 once you are ready.

Cheating

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.

Scores

You can view your official MP1 scores below.