Module 5 Flashcards

1
Q

These define the structure for a user interface in your app, such as in an activity.

A

Layouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False.
All elements in layouts are built using a hierarchy of View objects.

A

False.
(built using a hierarchy of View and ViewGroup objects)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This usually draws something the user can see and interact with.

A

View

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This is a/an invisible container that defines the layout structure for View and other ViewGroup objects.

A

ViewGroup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True or False.
Each layout file must contain only one root element, which must be a View or a ViewGroup object.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

True or False.
Once you’ve defined the root element, you can no longer add additional layout objects or widgets as child elements to gradually build a View hierarchy that defines your layout.

A

False.
(you CAN add additional layout objects)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

View objects are also known as “____”.

A

Widgets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

ViewGroup objects are also known as “______”.

A

Layouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two ways that View and ViewGroup can be declared?

A
  • Declare UI Elements in XML
  • Instantiate Layout Elements at Runtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A unique resource name for the element, which you can use to obtain a reference to the View or ViewGroup from your application.

A

Resource ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the correct syntax for referencing an Android resource ID?

A

android:id=”@id/resource_id”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Assume that you have defined a button in your XML file with the id, “clicker”.

What is the proper syntax for creating an instance of the view object and capture it from the layout?

A

Button varName = (Button) findViewById(R.id.clicker)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the different layout types?

A
  • Linear Layout
  • Relative Layout
  • Frame Layout
  • Table Layout
  • Web View
  • List View
  • Grid View
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

It is a ViewGroup subclass which is used to render all child View instances one by one either in Horizontal direction or Vertical direction based on the orientation property.

A

Linear Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In android, we can specify the linear layout orientation using ____________ attribute.

A

android:orientation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

It is a ViewGroup which is used to specify the position of child View instances relative to each other (Child A to the left of Child B) or relative to the parent (Aligned to the top of parent).

A

Relative Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

It is very useful to design user interface using this layout because we can eliminate the nested view groups and keep our layout hierarchy flat, which improves performance of application.

A

Relative Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

It is a ViewGroup subclass which is used to specify the position of View instances it contains on the top of each other to display only single View inside the layout.

A

Frame Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

In simple manner, we can say _________ is designed to block out an area on the screen to display a single item.

A

Frame Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In this layout, the child views are added in a stack and the most recently added child will show on the top.

A

Frame Layout

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

We can add multiple children views to FrameLayout and control their position by using _______ attributes in FrameLayout.

A

gravity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

It is a ViewGroup subclass which is used to display the child View elements in rows and columns.

A

Table Layout

23
Q

True or False.
Table Layout positions its children elements into rows and columns and displays any border lines for rows, columns or cells.

A

False.
(it will NOT display any border lines)

24
Q

It is an extension of View class and it is used to show the static HTML web pages content or remote web pages content with URL in android applications as a part of our activity layout.

A

Web View

25
Q

True or False.
Generally, in android the WebView will act as an embedded browser to include the web pages content in our activity layout and including features of normal browser, such as address bar, navigation controls, etc.

A

False.
(IT WON’T CONTAIN ANY features of normal browsers)

26
Q

It is a ViewGroup which is used to display the list of scrollable of items in multiple rows and the list items are automatically inserted to the list using an adapter.

A

List View

27
Q

This will hold the data and iterates through an items in data set and generate the views for each item in the list.

A

Adapter

27
Q

It acts as an intermediate between the data sources and adapter views, to fill the data into adapter views.

A

Adapter

28
Q

They are the interactive components in your app’s user interface.

A

Input Controls

29
Q

It is a ViewGroup which is used to display items in a two dimensional, scrollable grid and grid items are automatically inserted to the gridview layout using a list adapter.

A

Grid View

30
Q

A ________ is an object that holds other View (and ViewGroup) objects in order to define the layout of the user interface.

A

ViewGroup

31
Q

A ______ is an object that draws something on the screen that the user can interact with.

A

View

32
Q

This control is used to display text to the user.

A

TextView

33
Q

A predefined subclass of TextView that includes rich editing capabilities.

A

EditText

34
Q

A view that is similar to EditText, except that it shows a list of completion suggestions.

A

AutoCompleteTextView

35
Q

A push-button that can be pressed, or clicked, by the user to perform an action.

A

ButtonA

36
Q

An AbsoluteLayout which enables you to specify the exact location of its children. This shows a button with an image (instead of text) that can be pressed or clicked by the user.

A

ImageButtonAn

37
Q

An on/off switch that can be toggled by the user.

A

CheckBox

38
Q

This type of control should be used when presenting users with a group of selectable options that are not mutually exclusive.

A

CheckBox

39
Q

An on/off button with a light indicator.

A

ToggleButton

40
Q

This control has two states: either checked or unchecked.

A

RadioButton

41
Q

A _________ is used to group together one or more RadioButtons

A

RadioGroup

42
Q

This view provides visual feedback about some ongoing tasks, such as when you are performing a task in the background.

A

ProgressBar

43
Q

A drop-down list that allows users to select one value from a set.

A

Spinner

43
Q

This view enables users to select a time of the day, in either 24-hour mode or AM/PM mode.

A

TimePicker

44
Q

This view enables users to select a date of the day.

A

DatePicker

45
Q

It is an interface in the View class that contains a single callback method.

A

Event Listener

46
Q

This is called when the user either clicks or touches or focuses upon any widget like button, text, image etc.

A

onClick(); OnClickListener()

46
Q

This is called when the user either clicks or touches or focuses upon any widget like button, text, image etc. for one or more seconds.

A

onLongClick(); OnLongClickListener()

47
Q

This is called when the widget looses its focus ie. user goes away from the view item.

A

onFocusChange(); OnFocusChangeListener()

48
Q

This is called when the user is focused on the item and presses or releases a hardware key on the device.

A

onKey(); OnKeyListener()

49
Q

This is called when the user presses the key, releases the key, or any movement gesture on the screen

A

onTouch(); OnTouchListener()

50
Q

This is called when the context menu is being built(as the result of a sustained “long click)

A

onCreateContextMenu(); onCreateContextMenuItem
Listener()

50
Q

This is called when the user selects a menu item.

A

onMenuItemClick(); OnMenuItemClickListener()