Subscribe / Unsubscribe Enewsletters | Login | Register

Pencil Banner

Android Studio for beginners, Part 1: Installation and setup

Jeff Friesen | Aug. 24, 2016
Install Android Studio and start your first Android project

Figure 18. Customize your activity

Enter W2A as the activity name and main as the layout name, and click Finish to complete this step. Android Studio will respond that it is creating the project, then take you to the project workspace.

You are initially greeted with the Tip of the Day dialog box, which you can easily disable if desired.

Figure 19. Android Studio workspace

The project workspace is organized around a menu bar, a tool bar, a work area, additional components that lead to more windows (such as a Gradle Console window), and a status bar. Also note the Tip of the Day dialog box, which you can disable if you like.

Accessing AVD Manager or SDK Manager from menu and tool bar

To access the traditional AVD Manager or SDK Manager, select Android from the Tools menu followed by AVD Manager or SDK Manager from the resulting pop-up menu (or click their tool bar icons).

The project and editor windows

When you enter the project workspace, W2A is identified as the current project, but you won't immediately see the project details. After a few moments, these details will appear in two new windows.

Project information appears in the window on the left; a tabbed editor window appears on the right.

Figure 20. The project and editor windows

The project window is organized into a tree whose main branches are App and Gradle Scripts. The App branch is further organized into manifests, java, and res subbranches:

  • manifests stores AndroidManifest.xml, which is an XML file that describes the structure of an Android app. This file also records permission settings (where applicable) and other details about the app.
  • java stores an app's Java source files according to a package hierarchy, which is ca.javajeff.w2a in this example.
  • res stores an app's resource files, which are organized into drawable, layout, mipmap, and values subbranches:
    • drawable: an initially empty location in which to store an app's artwork
    • layout: a location containing an app's layout files; initially, main.xml (the main activity's layout file) is stored here
    • mipmap: a location containing various ic_launcher.png files that store launcher screen icons of different resolutions
    • values: a location containing colors.xml, dimens.xml, strings.xml, and styles.xml

The Gradle Scripts branch identifies various .gradle (such as build.gradle) and .properties (such as files that are used by the Gradle-based build system.

Branch names and directory/file names

Each branch/sub-branch corresponds to a directory name or to a file name. For example, res corresponds to the res directory and strings.xml corresponds to the strings.xml file.

Conclusion to Part 1

You've installed and configured Android Studio and created a project for your first Android Studio mobile app; now you're ready to build your Android application. In Android Studio, this means populating your new project with Java source code and resource files for a mobile app. Turn to Part 2 when you're ready to get started with your first Android animated mobile app.


Previous Page  1  2  3  4  5 

Sign up for CIO Asia eNewsletters.