The graphical user interface for an Android app is built using a hierarchy of UI elements where:
You can declare then a user interface by building a viewgroup
The UI elements are instantiated from an activity or a fragment (sub-activity). They instantiated what is called as the main thread.
From a performance point of view, you are better off with more siblings and less children in your UI hierarchy (no more than 18 views in total or 10 nested views).
The GUI can be declared:
You can declare a user interface (that always start with a viewGroup then) in two ways: