Lesson Plan: Unit - 03
Subject: P15A2AAD - Android Application Development
Topic of Study: Introduction to Android View, Layout and Control
Grade/Level: Master of Computer Applications
Objective: To understand the View and Layouts.
Time Allotment: 55 Minutes
- Introducing the Android Views
- The Android SDK has a Java packaged named android.view.
- This package contains a number of interfaces and classes related to drawing on the screen.
- However, when we refer to the View object, we actually refer to only one of the classes within this package: the android.view.View class.
- The View class is the basic user interface building block within Android.
- It represents a rectangular portion of the screen.
- The View class serves as the base class for nearly all the user interface controls and layouts within the Android SDK.
- View in XML
- Exa.
- Output of view.
- Exa.
- Introducing the Android Layout
- One special type of control found within the android.widget package is called a layout.
- A layout control is still a View object, but it doesn’t actually draw anything specific on the screen.
- Instead, it is a parent container for organizing other controls (children).
- Layout controls determine how and where on the screen child controls are drawn.
- Each type of layout control draws its children using particular rules.
- Exa. the LinearLayout control draws its child controls in a single horizontal row or a single vertical column.
- Exa.
- Output:
- Exa. TableLayout control displays each child control in tabular format (in cells within specific rows and columns).
- Introducing the Android Views
- The Android SDK contains a Java package named android.widget.
- When we refer to controls, we are typically referring to a class within this package.
- The Android SDK includes classes to draw most common objects, including ImageView, EditText, and Button classes.
- As mentioned previously, all controls are typically derived from the View class.
- Exa.