The Widget Exploration app
So far, we have discussed seven widgets: EditText
, ImageView
, RadioButton
(and RadioGroup
), Switch
, CheckBox
, TextClock
, and WebView
. Let's make a working app and do something real with each of them. We will also use a Button
widget and a TextView
widget again.
Remember that you can refer to the completed code in the download bundle. This app can be found in Chapter 13/Widget Exploration
.
Setting up the Widget Exploration project and UI
First, we will set up a new project and prepare the UI layout. These steps will arrange all the widgets on the screen and set the id
properties, ready to grab a reference to them. It is useful to look at the target layout – while it is up and running – before we get started. Take a look at the following screenshot:
Here is how this app will demonstrate these widgets:
- The radio buttons allow the user to change the time...