Figure 1. Illustration of a view hierarchy, which defines a UI layout.
To declare your layout, you can instantiate View objects in code and start building a tree, but the easiest and most effective way to define your layout is with an XML file. XML offers a human-readable structure for the layout, similar to HTML.
The name of an XML element for a view is respective to the Android class it represents. So a element creates a TextView widget in your UI, and a element creates a LinearLayout view group.
For example, a simple vertical layout with a text view and a button looks like this: