Task 2: Create your First Project
When you open Android Studio, you’ll be greeted with a screen that displays a couple options.
​
-
Click the New Project button.
-
Click the Basic Views Activity to create a template for your first app.

-
Name your application and set the language to Java. Leave everything else as the default.
-
Click Finish.
​
Now, Android Studio has created a new folder for your app in your default directory. Because we started with the Basic Views Activity template, there are a number of folders and files that have been initialized for us.
​
The code editor should now be open displaying a couple of panels and windows.
​
-
If anything is open on the right, click the minimize button.

-
Resize the panels until the code editor is unobstructed and the file explorer on the right is taking up less space.

You can look at the hierarchy of the files for your app in multiple ways, and one is in Android view. Android view shows your files and folders structured in a way that is convenient for working with an Android project. (This does not always match the file hierarchy! To see the file hierarchy, choose the Project Files view by clicking (3).)
​
-
Make sure the app (1) folder is expanded. (See (1) in the screenshot.)
-
If you click the Project (2) button, you can hide or show the Project hierarchy.
-
Make sure the current Project view selection (3) is Project > Android.
​
You should be seeing four folders: manifests, java, res and Gradle Scripts. Ignore Gradle Scripts for now.
​
-
Expand the manifests folder.
-
This folder contains AndroidManifest.xml. This file describes all the components of your Android app and is read by the Android runtime system when your app is executed.
-
​
-
Expand the java folder. All your Java language files are organized here. The java folder contains three subfolders:
-
com.example.myfirstapp: This folder contains the Java source code files for your app.
-
com.example.myfirstapp (androidTest): This folder is where you would put your instrumented tests, which are tests that run on an Android device. It starts out with a skeleton test file.
-
com.example.myfirstapp (test): This folder is where you would put your unit tests. Unit tests don't need an Android device to run. It starts out with a skeleton unit test file.
-
​
-
Expand the res folder. This folder contains all the resources for your app, including images, layout files, strings, icons, and styling. It includes these subfolders:
-
drawable: All your app's images will be stored in this folder.
-
layout: This folder contains the UI layout files for your activities. Currently, your app has one activity that has a layout file called activity_main.xml. It also contains content_main.xml, fragment_first.xml, and fragment_second.xml.
-
menu: This folder contains XML files describing any menus in your app.
-
mipmap: This folder contains the launcher icons for your app.
-
navigation: This folder contains the navigation graph, which tells Android Studio how to navigate between different parts of your application.
-
values: This folder contains resources, such as strings and colors, used in your app.
-
xml: This folder contains files that are used by Android Studio. They can be ignored for now.
-
​
In order to simulate your app, you need to have a working simulation of Android itself. That’s where virtual devices come in. Android Studio is able to simulate an entire phone directly within your code editor!
-
On the right side of the screen, click the Device Manager button.
-
Click the + button near the top of the panel to create a new configuration.

-
You will be shown a list of pre-configured hardware definitions. Choose any device and click Next.
-
From the Recommended tab, choose the latest release (API 34) and download it if necessary. Click Next.
-
Accept the default values and click Finish.
​
Now that you have configured a device that runs Android, it’s time to run the app for the first time.
-
Click the Run button at the top of the window to run your app.

Give the emulator some time to boot the device. It may be slower or faster depending on your computer’s speed.
-
During this time, you will see status messages at the bottom of your window. These indicate that Android Studio is working to build your app and will warn you of any errors.
​
Eventually, you will see the image of a smartphone appear with Android booting on it. Then, your app will open and you’ll be presented with the first version of your new app!
-
Note: It is a good practice to start the emulator at the beginning of your session. Don't close the emulator until you are done testing your app, so that you don't have to wait for the emulator to boot again. Also, don't have more than one emulator running at once, to reduce memory usage.
​
Go ahead and poke around to get an idea of what your app does. Because we chose the Basic Views Activity as a template, there are already some elements present. We will learn how to edit these in later steps.
-
If you click the mail button, you will see a notification appear on the snackbar where users are briefly notified.
-
At the top, there’s a menu with three dots. This contains a settings menu that doesn’t do anything, but is there to be user-configurable.

You’ve finished this task! Next, you will look at exploring the layout editor.