Chapter 5Layouts with Android Studio
WHAT'S IN THIS CHAPTER?
- 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 WITH ANDROID STUDIO
Layouts define the structure for a user interface in Android applications ...
Get Expert Android Studio 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.