2.5 Building the App’s GUI with the Layout Editor

You’ll now create the Welcome app’s GUI. The IDE’s layout editor allows you to build your GUI by dragging and dropping views—such as TextViews, ImageViews and Buttons—onto the layout editor. By default, the GUI layout for an app based on the Empty Activity template is stored in an XML file called activity_main.xml, located in the project’s res folder in the layout subfolder. In this chapter, we’ll use the layout editor and the Component Tree window to build the GUI. You’ll edit the XML in activity_main.xml only to change the layout used to arrange this app’s TextView and ImageView.

2.5.1 Adding an Image to the Project

For this app, you’ll need to add an image to the project. We’ll use the Deitel ...

Get Android How to Program, 3/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.