Android Studio Setup
To complete the Android CS 125 labs and machine project (MP) you’ll write your Java code 1 using the Android Studio Integrated Development Environment (IDE) and test your apps using the Android Emulator—and on a real device, if you have one. This guide will help you install and configure this important and powerful development tool.
1. Android Studio
Android Studio is the integrated development environment (IDE) for Android development. This semester all the machine project and final project will be done using Android Studio.
Follow the instructions below that are appropriate for your machine. But keep in mind that installing new software can be challenging, so don’t be discouraged if you get stuck. We’re here to help! Come to office hours or post on the forum in the Android Studio category.
1.1. Version
For Spring 2020 we are using Android Studio version 3.5.3, which is the latest available as of January 2020. Please install this version of Android Studio and continue using it throughout the semester.
If a upgrade is released, the course staff will let you know if it is safe to use. Please don’t upgrade until you get the OK from us, since even minor upgrades may affect your ability to work on the machine project.
1.2. Installation
Begin by downloading the version of Android Studio appropriate for your machine using this link. Next, follow these excellent installation instructions. Please follow them carefully.
2. Android Studio Plugins
Once you have installed Android Studio, continue by installing two Android Studio plugins:
2.1. checkstyle
Plugin
We use
checkstyle
to help you learn how to write beautiful and maintainable code by requiring you
to adhere to a coding standard.
There are checkstyle
points on each MP checkpoint, so you want to get the plugin
installed so that you can check your style as you go.
Installing this plugin is straightforward:
-
Open the Android Studio plugins menu
-
Open the "Marketplace" menu
-
Search for "checkstyle" and install the "Checkstyle-IDEA" plugin that appears
-
Restart Android Studio to complete the installation
You should install the latest version of the checkstyle
plugin, currently
5.35.4
.
checkstyle
plugin updates that are released during the semester should be safe
to install.
2.2. CS 125 IntelliJ Plugin
Our official CS 125 IntelliJ plugin will both simplify your MP development process and help us ensure that you are making satisfactory progress on each assignment. You can read more about it here.
Installing our plugin is straightforward and similar to installing the checkstyle
plugin.
-
Open the Android Studio plugins menu
-
Click on "Browse repositories…"
-
Search for "CS 125" and install the "CS 125 @ Illinois" plugin that appears
-
Restart Android Studio to complete the installation
You should install the latest version of our plugin, currently 2020.2.0.191
, and
any updates we release during the semester.
3. Android Emulator
An important part of Android development is to be able to test your work. If you have an Android device, you can configure Android Studio to install your test app onto it. However, if you don’t have an Android device, or want to test on devices other than ones that you own, you’ll need to utilize the Android Emulator.
The easiest way to get a virtual device set up is to start a project, build it, and then try to run it. That will launch a dialog allowing you to configure a virtual device. Going through the Android "Hello, World!" tutorial is also a great way to get started familiarizing yourself with app development.
4. Installing Git
Before you can use Git with Android Studio you may need to install the underlying Git tool itself. We suggest you follow these instructions to install Git. Once you complete the installation, Android Studio should automatically detect Git and allow you to use it to manage your Android projects.
Note that you do not need to install a GUI for Git—or the GitHub Desktop application. We’re going to use Android Studio’s excellent built-in Git interface. So once you’ve installed Git you can move on.
5. Running on Real Devices
If you have an Android phone you can also install and run your apps on your own device, which will be faster and more fun that using the emulator. Follow this tutorial for instructions on how to configure your device properly to run your apps during development.
6. You’re a Hacker Now
Note that we are definitely throwing you into the deep end with Android Studio. As you work your way through the Android "Hello, World!" tutorial you will definitely encounter code and concepts that are new and unfamiliar to you. That’s normal.
CS 125 is designed to introduce you to two sides of programming and computer science. In lectures and on our homework problems and quizzes you’ll be working on clean, simple, isolated problems. Our goal is to prepare you to think and solve problems like a computer scientist.
But building real things also requires a different set of skills and mindset, sometimes referred to as hacking. Hacking involves learning how to work with large, complicated systems. It means spending more time learning about how other things work than building your own things. It requires that you get comfortable not necessarily understanding how every part of your program works—at least not right away.
You’ll get lots of practice at this on our labs and MPs, starting today. Our advice: be brave and unafraid. Try things, experiment, and have fun. You aren’t going to break anything important, and even if you get a mess and get stuck we’ll be able to help bail you out. And the rewards are huge. Once you can hack together Android apps, you can distribute them to billions of users all over the world. When we said "change the world", we meant it.
7. Modifying "Hello, World"
Once you have the "Hello, world!" app running, try to make the following modifications:
-
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
Your goal before we release MP0 should be to at least complete through the "Build a simple user interface" portion of the tutorial. That will prepare your will to begin the machine project.