All the UI elements extends from the view class
Views are rectangle on the screen (same concept than box in CSS) where you may or may not view the borders.
A View occupies a rectangular area on the screen and is responsible for:
If you want to group simple widgets, you need a container descending from a ViewGroup
See design component
Width and height can have only two values:
There is then 4 possible combinations and possible outcomes when the view is in a parent (green)
Gravity of a view (Red) in a parent (green)
ScrollView: Extension of the FrameLayout class (meaning you should place one child in it containing the entire contents to scroll) that allows the user to scroll vertically to reveal more content than can be displayed on screen at once. The ScrollView is often used to contain a vertically oriented LinearLayout into which you can place any linear layout that in turn arranges each item it contains into a vertical list.
by id
Button myButton = (Button) findViewById(R.id.my_button);