Activities and layouts
Android applications are are made up of one or more screens called activities. So as to keep design and function separate, the appearance of an activity is defined in XML, and its behavior with Java. Creating an Android Studio project using the Blank Activity template is a good way to see how this works.
XML activities contain two types of screen components. There are all the visible screen objects, called widgets, that we associate with mobile apps, such as buttons, sliders, and images, and there are invisible container objects known as layouts or ViewGroups. If you open the activity_main.xml
XML file that was created by the project template, in design mode, you will see that there are seven layouts available to us at the top of the palette.
RelativeLayouts
On the right-hand side of the editor is the component tree; this displays a hierarchical view of the activity, and we can see that the root layout here is a RelativeLayout, and that it contains a single widget,...