Now that you have an idea of how views, ViewGroups, and Layouts come together to create a user interface, and how to create your user interface programmatically and in XML, it's time to look at each of Android's most common UI components in more detail. We'll start with the component that pretty much lays the foundation of any user interface: a layout container.
The Android platform supports a range of layouts, so your first task is deciding which layout best meets your design needs. If you're struggling to make this decision, keep in mind that you can nest layouts within one another to create your perfect layout container.
Note
Don't go overboard with the nesting as this can have a negative impact on your app's performance. If you find yourself nesting multiple layouts, then this could be a sign that you're using the wrong kind of layout!
Before you create any kind of layout, here are a few rules, regulations, and attributes that you need to get to grips with.