Book Image

Android Studio Essentials

By : Belén Cruz Zapata
Book Image

Android Studio Essentials

By: Belén Cruz Zapata

Overview of this book

<p>Android Studio is an IDE that is based on the JetBrains IntelliJ IDEA. It gives developers a unique platform to develop and debug Android apps using various developer tools. It has a wide array of features such as live layout facility, Gradle build support, and template-based wizards, which makes it a preferred choice for developers.</p> <p>Starting off with the basic installation and configuration of Android Studio, this book aids you in building a new project by helping you to create a custom launcher icon and guiding you to choose your activity. You then gain an insight on the additional tools provided in Android Studio, namely the Software Development Kit (SDK) Manager, Android Virtual Device (AVD) Manager, and Javadoc.</p> <p>Finally, it helps you to familiarize yourself with the Help section in Android Studio that enables you to search for the help you might require in different scenarios.</p>
Table of Contents (17 chapters)
Android Studio Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The Navigation Editor


The Navigation Editor is a tool used to create and structure the layouts of the application using a graphical viewer. To open this tool, navigate to Tools | Android | Navigation Editor. This tool opens a file in XML format, named main.nvg.xml. This file is stored in your project at /.navigation/app/raw/.

Since there is only one layout (and one activity) in our project, the navigation editor only shows this main layout. If you select the layout, detailed information about it is displayed on the panel on the right-hand side of the editor. If you double-click on the layout, the XML layout file will be opened in a new tab.

We can create a new activity by right-clicking on the editor and selecting the New Activity option. We can also add transitions from the controls of a layout by shift clicking on a control and then dragging to the target activity.

Open the main layout and create a new button with the Open Activity label:

<Button
        android:id="@+id/button_open"
 ...