Introducing Views

As described earlier, all visual components in Android descend from the view class and are referred to generically as Views. You'll often see Views referred to as controls or widgets (not to be confused with home screen or App Widgets described in Chapter 10) — terms you're probably familiar with if you've previously done any GUI development.

The viewGroup class is an extension of View designed to contain multiple Views. Generally, View Groups are used either to construct atomic reusable components or to manage the layout of child Views. View Groups that perform the latter function are generally referred to as layouts.

Because all visual elements derive from View, you will likely see both widget and control used interchangeably with View.

You were already introduced to a layout and two native Views — the LinearLayout, a Listview, and a Textview — when you created the to-do list example in Chapter 2.

In the following sections you'll learn how to put together increasingly complex UIs, starting with the Views available in the SDK, before learning how to extend them, build your own compound controls, and create your own custom Views from scratch.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide


Post a comment