Android provides a useful variety of Layout classes for containing and organizing the individual elements of an activity such as buttons, checkboxes, and other views.
The Android User Interface is defined as a hierarchy of Views and ViewGroups. The ViewGroup
is a container object that acts as the base class for Android's family of Layout classes, which are extended from it.
Layouts can be combined and nested to produce almost any configuration of visual screen components that we can imagine. This hierarchy of views can be, and mostly is, declared statically using XML files. The root node of these files must be a ViewGroup, that is, one of the provided Layout classes or a custom ViewGroup that we have created ourselves. Terminating nodes in the structure are all either Views or subclasses of the View object.
Android provides several built-in layout types designed for specific purposes, such as the RelativeLayout
which allows views to be positioned with respect to other elements...