Warning: Outdated Content
This MP is from a previous version of CS 125. Click here to access the latest version.
Android Studio Setup
To complete the Android CS 125 machine problems (MPs) you’ll write your Java code using the Android Studio Integrated Development Environment (IDE) and test your apps using the Android Emulator. This guide will help you install and configure this important and powerful development tool.
Note that if have not installed Java you should do that first. Return here when you’re done. Also note that you only need Android Studio for the Android-based MPs—this semester starting with MP4.
1. Android Studio
Android Studio is the integrated development environment (IDE) for Android development. Happily, Android Studio is based on IntelliJ, which you are have already been using for previous MPs.
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 Fall 2018 we are using Android Studio version 3.2, which is the latest available as of October 2018. Please install this version of Android Studio and continue using it throughout the semester. Minor upgrades are probably safe to install. If a major upgrade is released, the course staff will let you if it is safe to use.
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. checkstyle
Plugin
Once you have installed Android Studio, continue by installing the Checkstyle-IDEA IntelliJ plugin. It’s the same one that you used for your Java assignments using IntelliJ, but should also work on Android Studio, and you can follow the same instructions.
Note that our CS 125 plugin is not yet compatible with Android Studio. We hope to fix that soon.
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.
4. 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.
5. Hello, Android!
Once you have completed the steps above you should be able to work through creating and building Google’s "Hello, World!" example app. It’s a great introduction to Android development from start to finish, and covers aspects of app creation that we will not cover on MP4 or MP5.