
Import ĪnimationDrawable void onCreate(Bundle savedInstanceState) The activity's source code is stored in the file W2A.java, presented in Listing 1. In this section, we'll explore the activity's source code and resources. When the user presses the button, the robot animates through a series of colors. The example app ( W2A.java) consists of a main activity that displays the Android robot character and a button. You move from one editor window to another by clicking the window's tab.ĭownload the source code for the Android example app: W2A.java. A second tab identified as main.xml (the default XML-based layout for the app's main activity) is also shown. For example, W2A's editor window is associated with a W2A.java tab. The editor window reveals the file's current contents, in this case the skeletal Java source code for the app's main activity.Įach editor window is associated with a tab. Corresponding to W2A is an editor window, reached by double-clicking W2A in the Project window. The Project window highlights W2A, which is the name of the app's W2A.java source file (although the. Android Studio's Project window and an editor window (click to enlarge)

The Project window and an editor window are shown in Figure 1. This window is divided into several areas, including a Project window where you identify an app's resource files, and various editor windows where you'll write the code and specify resources for mobile apps in Android Studio. I introduced Android Studio's main window at the end of Part 1. Android Studio's Project and editor windows

Note that this series has been updated for Android Studio 3.2.1, the current stable release as of this writing.
