The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.
This chapter will serve as a quick tour of the Android Studio IDE, to help you get settled in. Other Android-specific capabilities of Android Studio will be explored in the chapters that follow.
After the main editing area — where you will modify your Java source code, your resources, and so forth — the piece of Android Studio you will spend the most time with is the project explorer, usually available on the left side of the IDE window:
Figure 34: Android Studio Project Explorer, Showing Android Project View
This explorer pane has two main “project views” that an Android developer will use: the Android project view and the classic project view.
By default, when you create or import a project, you will wind up in the Android project view.
In theory, the Android project view is designed to simplify working with Android project files. In practice, it may do so, but only for some advanced developers. On the whole, it makes the IDE significantly more complicated for newcomers to Android, as it is rather difficult to see where things are and what relates to what.
We will return to the Android project view a bit later in the book and explain its benefits relative to resources and Gradle’s source sets.
However, for most of the book — most importantly, for the tutorials – we will use the classic project view.
To switch to the classic project view, click the pair of arrowheads to the right of the “Project Files” tab just above the tree in the explorer, and choose Project:
Figure 35: Android Studio Project Explorer, Showing Project View Drop-Down
On some machines, in some cases, the pair of arrowheads is instead a single drop-down arrowhead next to the currently-chosen view (e.g., Android).
Switching to the project view will change the contents of the tree to show you all of the files, in their associated directories:
Figure 36: Android Studio Project Explorer, Showing Classic Project View
This project view is much like its equivalent in other IDEs, allowing you to find all of the pieces of your Android project. We will be exploring what those pieces are, and how their files are organized in our projects, in the next chapter.
Right-clicking over a directory or file in the explorer will give you a context menu with a variety of options. Some of these will be typical of any sort of file manager, such as “cut”, “copy”, and/or “paste” options. Some of these will be organized according to how Android Studio manages application development, such as the “Refactor” sub-menu, where you can rename or move files around. Yet others will be specific to Android Studio, such as the ability to invoke wizards to create certain types of Android components or other Java classes.
Double-clicking on a file usually opens that file in a tab that allows you to edit that file, using some sort of editor.
Some file types, like images, can be opened but not edited, as Android Studio does not have editors for all file types.
The preview of this section apparently resembled a Pokémon.
The preview of this section was last seen in the Bermuda Triangle.
The preview of this section did not survive Thanos's finger snap.
The preview of this section was stepped on by Godzilla.
The preview of this section is in the process of being translated from its native Klingon.