Warning: Outdated Content
This lab is from a previous version of CS 125. Click here to access the latest version.
Today’s lab marks the beginning of the end of your introduction to computer science. You’ll begin preliminary work on your final project and gain insights into how to design a user interface.
Note that there is no written part of this lab. Instead, we’ll expect you to seek out any required information yourself or consulting your lab members for help.
1. Pair Programming
You’ll work in pairs on today’s activity. You should pick with and work with your final project partner. And you’ll also have a chance to practice a programming approach called pair programming.
1.1. Picking a Project Partner
Today you should pick someone that you will work with on your final project and in lab together for the next few weeks. Obviously you want to find someone to work with that you enjoy working with and think that you can do an awesome project with—since we will be giving extra credit for some of the best projects. Another consideration is ensuring that at least one of you has a laptop that can smoothly run Android Studio and the emulator, or an Android phone for demoing your new application.
If you don’t have a partner yet, find one before proceeding.
If you would like to work with someone from another lab section, you must both attend the same lab and work together. This means that only one of you will receive participation credit for that lab–or you can attend both labs. You will not receive credit for working in lab without your partner. If you want to work with someone from another lab, this is the tradeoff you will have to make. (Remember that you have three excused lab absences.)
1.2. Pair Programming
By now you’ve probably realized that programming is a mentally taxing full-brain activity. So, frequently when programming, two heads are literally better than one. That’s where the idea of pair programming comes from.
What is pair programming? Simply put, it describes any programming approach where two programmers work together simultaneously using a single machine. No—you don’t type with all four hands 1. Instead, pair programming divides the work into two roles:
Driver: this programmer touches the keyboard and does all code editing tasks.
Observer: the second programmer does not touch the keyboard but rather observes what the driver is doing, reviewing each line of code, asking questions, and generally serving as a guide and check on what the driver is doing.
As a metaphor, think about the process of navigating a vehicle before voice navigation 2. One person, the driver, keeps their hands on the wheel and their eyes on the road. The second person, the navigator, is able to observe the surroundings, look at the map, and generally help keep the trip on track.
Pair programmers should switch roles often, and you should multiple times as you complete the lab tasks below. Pair programming is widely used in industry, partly because it is sometimes considered to produce better code, but mainly because it’s more fun than working alone.
Why are we doing this today? Simple: we want to help make sure that you and your partner can communicate and work together effectively. Pair programming forces you to communicate with your partner. If you are driving and not communicating, your observer has no idea what you are trying to do. If you are observing and not communicating, your driver has no way to incorporate your guidance.
So please complete the following tasks using pair programming. Each group should only have one laptop active and the other put away.
2. Final Project Planning and UI Mockup (50 Minutes)
You and your partner should use today’s lab time to begin work on two important final project objectives.
First, you should decide what you are going to try and accomplish. Keep in mind how much time and energy you have left, your relative ability levels, and how much you want (or need) 1% extra credit. We also highly suggest working on a project that you enjoy. Excitement about the final product is extremely important to get you through the inevitable moments of frustration.
Once you have decided on a final project idea, you should begin sketching a user interface for your app. If you have some experience in this area, or just really like the UI portions of the machine project, then by all means consider something a bit complicated. Otherwise, stick with something simple.
Note that Android provides some built-in activities that come with basic layouts designed for certain types of apps. You can explore those by right-clicking on your project, choosing new and then either activity or Google, which also contains some starter activities.