KotlinCS 124 LogoJava
PrevIndexNext
Kotlin
Java
  • Implementing a Map : 04/26/2024

  • Streams : 04/25/2024

  • Generics : 04/24/2024

  • Hashing : 04/23/2024

  • Binary Search : 04/22/2024

  • MP3: Course Ratings : 04/19/2024

  • Quicksort : 04/18/2024

  • Merge Sort : 04/17/2024

  • Sorting Algorithms : 04/16/2024

  • MP Debugging Part 1 : 04/15/2024

  • MP2: Course Activity : 04/12/2024

  • Practice with Recursion : 04/11/2024

  • MP Debugging Part 0 : 04/10/2024

  • MP2: API Client : 04/09/2024

  • MP2: API Server : 04/08/2024

  • Trees and Recursion : 04/05/2024

  • Trees : 04/04/2024

  • Recursion : 04/03/2024

  • MP1: Filtering and Search : 04/02/2024

  • MP1: Loading and Sorting : 04/01/2024

  • Lists Review and Performance : 03/29/2024

  • Linked Lists : 03/28/2024

  • Algorithms and Lists : 03/27/2024

  • Continuing MP0 : 03/26/2024

  • Getting Started with MP0 : 03/25/2024

  • Lambda Expressions : 03/22/2024

  • Anonymous Classes : 03/21/2024

  • Practice with Interfaces : 03/20/2024

  • Implementing Interfaces : 03/19/2024

  • Using Interfaces : 03/18/2024

  • Working with Exceptions : 03/08/2024

  • Throwing Exceptions : 03/07/2024

  • Catching Exceptions : 03/06/2024

  • References and Polymorphism : 03/05/2024

  • References : 03/04/2024

  • Data Modeling 2 : 03/01/2024

  • Equality and Object Copying : 02/29/2024

  • Polymorphism : 02/28/2024

  • Inheritance : 02/27/2024

  • Data Modeling 1 : 02/26/2024

  • Static : 02/23/2024

  • Encapsulation : 02/22/2024

  • Constructors : 02/21/2024

  • Objects, Continued : 02/20/2024

  • Introduction to Objects : 02/19/2024

  • Compilation and Type Inference : 02/16/2024

  • Practice with Collections : 02/15/2024

  • Maps and Sets : 02/14/2024

  • Lists and Type Parameters : 02/13/2024

  • Imports and Libraries : 02/12/2024

  • Multidimensional Arrays : 02/09/2024

  • Practice with Strings : 02/08/2024

  • null : 02/07/2024

  • Algorithms and Strings : 02/06/2024

  • Strings : 02/05/2024

  • Functions and Algorithms : 02/02/2024

  • Practice with Functions : 02/01/2024

  • More About Functions : 01/31/2024

  • Errors and Debugging : 01/30/2024

  • Functions : 01/29/2024

  • Practice with Loops and Algorithms : 01/26/2024

  • Algorithms : 01/25/2024

  • Loops : 01/24/2024

  • Arrays : 01/23/2024

  • Compound Conditionals : 01/22/2024

  • Conditional Expressions and Statements : 01/19/2024

  • Operations on Variables : 01/18/2024

  • Variables and Types : 01/17/2024

  • Welcome to CS 124 : 01/16/2024

Getting Started with MP0

Welcome back! This lesson begins a new chapter in our journey together, as we begin work on the machine project.

MP0
MP0

Over the course of several checkpoints you’ll apply the knowledge you’ve learned so far to a real-world application: completing a simple Android app. Let’s get started!

Goals of the Machine Project
Goals of the Machine Project

We’ve built your programming abilities through a series of small homework problems. Now we’re excited to show you what you can do by applying those skills! So if the homework problems are like playing etudes on a musical instrument, now it’s time to learn a simple song. If the homework problems are like running cone drills at sports practice, now it’s time to scrimmage. If the homework problems are like the mise en place when preparing a meal, now it’s time to turn up the heat and get cooking.

Real world programming is also a very different challenge than you’ve experienced solving the homework problems. On each homework problem you start from scratch. In real life, you almost never do. On each homework problem you spend most of your time programming and debugging. In real life, you spend most of your time reading code, scratching your head, and figuring out where to start!

Compared to the homework problems: when completing the machine project, you’ll spend much more time:

And you’ll spend much less time writing code! This is normal, good, healthy, and not a sign that you are doing anything wrong.

Getting Started
Getting Started

Let’s go through the steps required to get you up and running on the machine project.

  1. First, we’ll install Android Studio and Git.
  2. Next, you’ll create a GitHub account, if you don’t have one already, and create your MP repository.
  3. Once that’s done, you’ll import that repository into Android Studio and run the test suites and grader.
  4. And, finally, you have a few small fixes to make before you can earn full credit!

We’ll get started on these tasks in this lesson and continue in the next.

Decide on Collaboration
Decide on Collaboration

Before you go too far, please review the MP collaboration policy. To summarize, you may choose:

Regadless of how you choose to collaborate, we will examine your code for plagiarism in the same way—with the exception that, if you work with a human partner, your code will be expected to be identical. If you choose to collaborate with another student, you must complete all work the with your partner. Please review the collaboration policy for more details.

Install Android Studio and Git
Install Android Studio and Git

Before you can start the machine project, you need to install some software onto your development machine. These instructions should help with that. Return here when you’re done.

Create Your GitHub Access Token
Create Your GitHub Access Token

If you don’t already have a GitHub account, start here to create one. Note that if you sign up with your @illinois.edu email address there are usually some freebies thrown in…

We’ll use a personal access token to allow Android Studio to access our GitHub repositories. Let’s walk through how to do that together! You can either use this link, or use the token creation dialog in Android Studio. (Note that these instructions are the same for Java and Kotlin.)

Note that you should configure a longer token expiration than 30 days. Recreating the token later isn’t a problem, but inevitably the token will expire five minutes before a deadline and cause stress and confusion.

Clone and Load the Machine Project Repository
Clone and Load the Machine Project Repository

Next, you need to get your copy of our MP starter code and load it into Android Studio. We don’t expect you to start the project from nothing! In fact, working with an existing codebase is the norm in the real world of software development. One of our learning goals is to get you comfortable with this type of development.

Once you have your GitHub account and have linked it to Android Studio using your access token, you can use this GitHub Classroom link to access the Java starter code. That may take a minute to set up. Please be patient.

Now we have Android Studio installed and our own copy of the machine project. The next step is to import the starter code into Android Studio! You’ll need Android Studio configured to access your GitHub account, as shown in the previous screencast. The screencast above walks you through the whole process.

To identify yourself you’ll need to add a unique ID to your project. Your ID should be shown below, and the screencast above shows you how to use it.

Run the App Using the Emulator
Run the App Using the Emulator

Now that we have the app source code, let’s finish up by running it on an emulated Android device. We’ll walk through the process of creating a device, and show you what you should expect to see when your app starts up. (Note that these instructions are the same for Java and Kotlin.)

Your Goal Today
Your Goal Today

On lessons where we focus on the machine project we will not assign a separate homework problem! However, the lesson will usually focus on helping you with a particular part of the MP test suite, and you should finish the lesson by completing that task.

Right now your goal should be to get Android Studio installed, the MP code imported, and to run the app in the emulator for the first time! If you get stuck, find us for help on the tutoring site or forum.