Introduction to Android

The goal of this lab is to prepare you to begin work on the Android set of MPs (MP4 and MP5) and your Android final project. You’ll prepare your development environment by installing Android Studio, build and run a simple Android app using the Android emulator.

1. Android Environment Preparation (80 Minutes)

In this section we’ll have you set up Android to prepare your computer to build Android apps and complete the next several MPs.

1.1. Install Android

Follow this tutorial to download and install Android Studio. Make sure to follow the instructions carefully, and ask the course staff for help if you need it.

1.2. Using the Android Emulator

Make sure that you complete the this portion of the tutorial. To work on MP4 and MP5, you will need either an Android device or a working emulator—even if it runs a bit slowly. Again, work with the course staff to try and complete this portion of the lab.

Once you have the "Hello, world!" application running, try to make the following modifications to this simple app:

  • Change the text that is shown to "Hello, CS 125!"

  • Change the size of the text

  • Change the position of the text

  • Add some other element to the user interface

1.3. Using the Emulated Camera (Optional)

As the final challenge for the Android portion of the lab, try to get the camera working on your emulated device. Feel free to skip this section if setting up Android took a while.

Consult the screencast above for instructions on how to do this. You can test whether your emulated camera is working by using the built-in Android Camera app. If possible, set up your emulated camera to use your computer’s built-in webcam, assuming it has one.

2. Getting Started on MP4 (30 Minutes)

Use the remainder of your lab time to get started on MP4. There is a fair amount of information in the write up to review, and because this is your first time working in Android the environment will feel a bit unfamiliar.

Here’s our suggestions about how to get started:

  1. First use the MP4 online documentation to finish enough of Transform.java so that your MP starts compiling. We suggest just returning the pixel array unmodified. This will mean that your app doesn’t work, but also won’t crash the way it will if you return null.

  2. Next make sure that you can build and run the Android app: either on your own phone, or on the emulator.

  3. Now pick one of the image transformations and get started! The easiest set is probably the image shifts, but the one that will earn you the most points the most rapidly is probably the green screen function 1.

3. Before You Leave

Don’t leave lab until:

  1. You have installed Android Studio

  2. You have been able to successfully run the Android "Hello, world!" app using the Android emulator or on your own device

  3. You have started MP4

  4. And so has everyone else in your lab section!

If you need more help, please come to office hours, or post on the forum.

CS 125 is now CS 124

This site is no longer maintained, may contain incorrect information, and may not function properly.


Created 10/24/2021
Updated 10/24/2021
Commit a44ff35 // History // View
Built 10/24/2021 @ 21:29 EDT