You are on page 1of 16

Lesson Objectives:

• Android App
• Views
• Exercises
• XML Syntax
• DIP or DP
• XML Visualizer
• Assignments
Android App

The basic components of


any android application are
the following:

• Activities
• Intent and broadcast
receivers
• Services
• Content Providers
• Widgets and
Notifications*
VIEWS

A View is a rectangular area


on the screen. For example,
a TextView displays text and
an ImageView displays an
image.

If a TextView doesn't specify


a text color or background
color, we get a default such
as gray text on a transparent
background. That's because
a set of default attributes,
called a style, is applied to
the TextView.
Exercise 1
Exercise 2
XML
Here are the words we will
discuss:
• XML element
• Tag
• Self-closing tags
• Attributes
• Syntax
• Parent XML
• Children XML elements
Attributes are characteristics
that determine the behavior
or the appearance of the view
on the Android phone.
Density-Independent Pixel (DP)
Density-Independent Pixel (DP)

Density-independent Pixels - an abstract unit that is based on the physical density of the screen.
These units are relative to a 160 dpi screen, so one dp is one pixel on a 160 dpi screen.
XML Visualizer Demo

XML Visualizer:
https://labs.udac
ity.com/android-
visualizer/#/andr
oid/text-view
Home Activity
EXERCISE 1
https://labs.udacity.com/android-visualizer/#/android/text-view
Home Activity
EXERCISE 2
https://labs.udacity.com/android-visualizer/#/android/wrap-content
Home Activity
EXERCISE 3
https://labs.udacity.com/android-visualizer/#/android/text-size
Home Activity
EXERCISE 4
https://labs.udacity.com/android-visualizer/#/android/text-color
Home Activity
EXERCISE 5
https://labs.udacity.com/android-visualizer/#/android/simple-imageview

You might also like