Now that we know how to create and run a basic Android app, let's spruce things up with widgets (see Figure 7):
textViewconsists of widgets such as
editText, Button, etc. Buttons can be further categorized into:
- ToggleButton, etc.
- ImageView consists of widgets such as the ImageButton.
- ViewGroup consists of layouts such as:
- Relative Layout
- Table Layout
- Frame Layout
- Adapter View
- Linear Layout
For information about widgets, "A Visual Guide to Android GUI Widgets" is the best guide. Be
cautious, however, of inconsistencies introduced there because of rapid
changes in the Android platform. One glaring example is the use of
id as an identifier attribute for a widget in
main.xml in the above-mentioned guide. In
the latest Android platform, the fully qualified
android:id should be used.
Figure 7. Android widgets hierarchy