0% found this document useful (0 votes)
34 views

Introduction To View, Control, Layout

The document discusses user interface design for Android applications. It explains that user interfaces are built using views and view groups, which represent user interface elements and define layouts. Common views include buttons, text fields, and various layouts like linear or relative layouts. Layouts organize other controls on the screen and determine how they are drawn. Specific view classes in the Android software development kit can be used to create common user interface elements and controls for applications.

Uploaded by

cshashank1992
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Introduction To View, Control, Layout

The document discusses user interface design for Android applications. It explains that user interfaces are built using views and view groups, which represent user interface elements and define layouts. Common views include buttons, text fields, and various layouts like linear or relative layouts. Layouts organize other controls on the screen and determine how they are drawn. Specific view classes in the Android software development kit can be used to create common user interface elements and controls for applications.

Uploaded by

cshashank1992
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Android development

Android User
Interface Design


User Interface Screen Elements
Most Android applications need some form of
user interface.
We develop these interfaces with elements
available within the Android Software
Development Kit (SDK).
Some of these elements display information to
the user, whereas others are input controls that
can be used to gather information from the
user.
Introducing Android Views and
Layouts
Before we can design User Interface Screen for
our application , we need to understand a few
terms.
These are:
1. VIEWS and VIEWGROUPS
2. CONTROLS
3. LAYOUTS
View And ViewGroup
All user interface elements in an Android app are built
using View and ViewGroup objects.
A View is an object that draws something on the
screen that the user can interact with.
A ViewGroup is an object that holds other
View (and ViewGroup) objects in order to define the
layout of the interface.
Android provides a collection of
both View and ViewGroup subclasses that offer you
common input controls (such as buttons and text
fields) and various layout models (such as a linear or
relative layout).

View
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.
It contains a class called View .
The View class serves as the base class for nearly
all the user interface controls and layouts within
the Android SDK
It represents a rectangular portion of the screen.
What is Control ?
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 TextView,
EditText, and Button classes.
As mentioned previously, all controls are
typically derived from the View class.
What is Control ?
Our layout resource files are composed of
different user interface controls. Some are static,
and we dont need to work with them
programmatically.
Others well want to be able to access and modify
in our Java code.
Each control we want to be able to access
programmatically must have a unique identifier
specified using the android:id attribute.
We use this identifier to access the control with
the findViewById() method in our Activity class.
What is 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 doesnt
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. For instance, the LinearLayout control
draws its child controls in a single horizontal row or a
single vertical column.

You might also like