p4-budget

EECS 285 Android Studio Setup and First App

First App Due Friday, 30 Nov 2018, 8pm

This tutorial will help walk you through setting up your computer with Android Studio for Project 4.

Table of Contents

System Requirements

The system requirements for Android Studio are listed at the bottom of the download page. If your computer does not meet the minimum requirements to run Android Studio, please see the EECS Departmental Computing Organization in 2917 BBB for a loaner computer.

Android Emulator

In order to run the Android emulator on Windows or Linux, your system must have an Intel CPU, and it must have hardware virtualization enabled. Mac computers usually already meet these requirements.

If you are on Windows, you can check if you have an Intel CPU by opening Explorer, right clicking on “This PC”, and selecting “Properties”. Your processor should be listed under “System”.

When launching the Android Emulator, if you see an error about hardware virtualization, you must enable it in the system BIOS for your computer. Refer to the following:

If your computer is able to run Android Studio, but not the emulator (e.g. if you have an AMD CPU), you can use a physical Android Device instead of the emulator. We have a few Android devices we can loan out for this. Please contact us as soon as possible if this is your situation.

Download and Install

First, download and install Android Studio. Under “Android Studio package”, click on the link for your platform. (If you are on Windows, the most likely one you want is “Windows (64-bit) Recommended”.) Accept the agreement, download, and run the installer. (On Mac, drag the “Android Studio.app” icon to the “Applications” icon.)

Start Android Studio to complete the installation. Select “Do not import settings”.

You will then see the Android Studio Setup Wizard. Click “Next”.

At “Install Type”, select “Custom” and click “Next”.

Select your preferred UI theme and click “Next”.

At “SDK Components Setup”, select both “Performance” and “Android Virtual Device”. Click “Next”.

For “Emulator Settings”, use the recommended settings and click “Next”.

At “Verify Settings”, click “Finish” and wait for installation to complete. You may need to enter your password during installation.

Complete the First App Tutorial

Follow the tutorial to build your first app. Make sure that you use the Java examples, not Kotlin.

When setting up your project, set your application name to be <uniqname>'s First App, where <uniqname> is your uniqname. If you are working in a partnership, then use both of your unqinames, in alphabetical order, separated by an underscore. For example, if I am working alone, I would use the following name:

If I am working with schatzju, then I would use the following:

Ignore the message at the bottom about application names beginning with an uppercase letter.

For the company domain, use proj4.eecs285. This will result in the package name automatically having the required format of eecs285.proj4.<uniqname>sfirstapp.

When selecting which Android Devices to target, choose “Phone and Tablet” and select API 24. You must use API 27 or lower. We recommend API 24 since it gives you more support for Java 8 features than earlier versions:

After your project is created, you need to configure it to support Java 8. Select “File” in the application menu and then “Project Structure”. Click on “app” in the left area, then set both “Source Compatibility” and “Target Compatibility” to 1.8:

You will also see that “Compile SDK Version” is set to a newer version than the target API you selected – this is fine, and you should not change it.

Complete the entire tutorial. At the end, you will have an app with two activities, the first of which has a text field and a button, and the second of which displays the text entered in the first activity.

Submit

Submit the following files to the autograder.

Refer to the guide on preparing files for submission for how to obtain the required files.

As per course policy, we will grade your last submission to the autograder. It is your responsibility to ensure that your last submission is complete.

The first app is worth 10% of your grade for Project 4.

Working with Git

If you are using Git for version control, we recommend using this .gitignore file, which excludes unnecessary files (e.g. IDE settings, build outputs, etc.). Rename the file to .gitignore and place it in the top-level directory for your project.

As always, make sure that your Git repository is private, as required by course policy.