Chapter 5Layouts with Android Studio


  • Layouts with Android Studio
  • Layout previews
  • Designing layouts with Android Studio
  • Resource management
  • Editing component properties
  • Using other layout tools
  • Asset management

So far in this book, we have covered Android Studio tools, mostly dealing with files and folders and assistants to the general application development process. This chapter explores details about another important part of the application development process: user interfaces.

User interfaces are defined with XML files in Android applications. User interface elements in Android are configured using XML tags and attributes. The Android operating system renders the user interface using the XML file and Java code to draw the user interface elements to Android devices.

Common terms used in Android UI development are layout, view, and widgets. We reference these many times in this chapter and in later chapters as well.

View is the base class of user interface elements. Widgets are derived from the View class and they become a ready-to-use user interface element such as images, texts, text inputs, drop-down boxes, and so on. Layouts are the containers for views and widgets; they are group of views.

You should now create a new project, as you did in Chapter 3. Name it ChapterFive and add a BlankActivity. You will use this new project in the following section.


Layouts define the structure for a user interface in Android applications ...

Get Expert Android Studio now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.