Datasheet

16
Part I: The Nuts and Bolts of Android
Views and widgets
What the heck is a view? A view is a basic UI element — a rectangular area on
the screen that is responsible for drawing and event handling. I like to think
of views as being basic controls, such as a label control in HTML. Here are a
few examples of views:
ContextMenu
Menu
View
Surface view
Widgets are more-advanced UI elements, such as check boxes. Think of them
as being the controls that your users interact with. Here are a few widgets:
Button
CheckBox
DatePicker
DigitalClock
Gallery
FrameLayout
ImageView
RelativeLayout
PopupWindow
Many more widgets are ready for you to use. Check out the android.
widget package in the Android documentation at http://developer.
android.com/reference/android/widget/package-summary.html
for complete details.
Asynchronous calls
Who called? I don’t know anybody named Asynchronous, do you?
The AsyncTask class in Android allows you to run multiple operations at the
same time without having to manage a separate thread yourself. AsyncTask
not only lets you start a new process without having to clean up after your-
self, but also returns the result to the activity that started it. This allows you
to have a clean programming model for asynchronous processing.
05_9780470770184-ch01.indd 1605_9780470770184-ch01.indd 16 11/2/10 8:51 AM11/2/10 8:51 AM