MOBILE PROGRAMMING FINAL EXAM REVIEWER

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/346

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

347 Terms

1
New cards

A layout defines the ______ for a user interface in your app, such as in an activity.

structure

2
New cards

Android UI elements are built using a hierarchy of ______ and ______ objects.

"View ViewGroup"

3
New cards

The object that draws something the user can see and interact with is called a ______.

View

4
New cards

The invisible container that defines the layout structure for View and other ViewGroup objects is called a ______.

ViewGroup

5
New cards

Each layout file must contain exactly one ______ element, which must be a View or ViewGroup object.

root

6
New cards

After defining the root element, you can add additional layout objects or widgets as ______ elements to build a View hierarchy.

child

7
New cards

View objects are often called ______ and include subclasses such as Button or TextView.

widgets

8
New cards

ViewGroup objects are often called ______ and include types such as LinearLayout or ConstraintLayout.

layouts

9
New cards

One way to define View and ViewGroup elements is to declare UI elements in ______.

XML

10
New cards

Another way to define View and ViewGroup elements is to instantiate layout elements at ______.

runtime

11
New cards

The file location for a layout resource is ______/layout/filename.xml.

res

12
New cards

In Java, you reference a layout resource using ______.layout.filename.

R

13
New cards

What is the syntax to reference a layout resource in XML? Use @[package:]______ /filename.

layout

14
New cards

A element is a container for other ______ elements.

View

15
New cards

Name three common ViewGroup subclasses mentioned in the reviewer.

LinearLayout, RelativeLayout, FrameLayout

16
New cards

Some ViewGroups are implementations of the ______ class and determine their children only from an Adapter.

AdapterView

17
New cards

Which attribute gives a View or ViewGroup a unique resource name?

android:id

18
New cards

Which attributes specify the height and width of a View or ViewGroup?

android:layout_height and android:layout_width

19
New cards

To create a new resource ID for a View, use the syntax '@+id/______'.

name

20
New cards

The '+' symbol in '@+id/name' indicates that a new ______ will be created if it doesn't already exist.

resource ID

21
New cards

When referencing an Android resource ID from the framework, use the syntax android:id='@______/resource_id'.

id

22
New cards

Dimension attributes such as android:layout_height can be expressed using units like px, dp, sp, pt, in or ______.

mm

23
New cards

Custom View elements allow you to create your own View and ViewGroup classes and specify supported ______ in the XML element.

attributes

24
New cards

In loading a view, you should define the view in the layout file and assign a unique ______.

ID

25
New cards

After defining a view in the layout file, create an instance and capture it from the layout typically in the ______ method.

onCreate()

26
New cards

Which layout arranges child View instances in either a horizontal or vertical direction based on the orientation property?

LinearLayout

27
New cards

The orientation of a LinearLayout is specified using the ______ attribute.

android:orientation

28
New cards

Which ViewGroup allows you to position child views relative to each other or the parent, eliminating nested view groups?

RelativeLayout

29
New cards

Using RelativeLayout helps keep the layout hierarchy ______, which improves performance.

flat

30
New cards

Which layout displays only a single view, stacking child views so the most recently added appears on top?

FrameLayout

31
New cards

FrameLayout acts as a ______ on the screen and holds a single child view.

placeholder

32
New cards

You can control the position of child views in a FrameLayout by using ______ attributes.

gravity

33
New cards

Which layout displays child elements in rows and columns similar to an HTML table?

TableLayout

34
New cards

In a TableLayout, the table will have as many columns as the row with the most ______.

cells

35
New cards

TableRow in Android TableLayout is analogous to which HTML tag?

36
New cards

Which layout is an extension of the View class that allows you to display static or remote web pages within an activity?

WebView

37
New cards

A WebView acts as an embedded browser but does NOT contain features of a normal browser such as the ______ or navigation controls.

address bar

38
New cards

Which ViewGroup displays a list of scrollable items in multiple rows with items automatically inserted using an adapter?

ListView

39
New cards

In a ListView, the ______ acts as an intermediate between the data source and the adapter view.

adapter

40
New cards

An adapter holds the data and iterates through items in the data set, generating views for each item in the ______.

list

41
New cards

Which ViewGroup displays items in a two‑dimensional scrollable grid with items inserted automatically using a list adapter?

GridView

42
New cards

Which control is used to display text to the user?

TextView

43
New cards

Which control is a predefined subclass of TextView that includes rich editing capabilities?

EditText

44
New cards

Which control is similar to EditText but shows a list of completion suggestions automatically while the user types?

AutoCompleteTextView

45
New cards

Which control provides a push‑button that can be pressed or clicked by the user to perform an action?

Button

46
New cards

Which control shows a button with an image instead of text and lets you specify the exact location of its children?

ImageButton

47
New cards

Which control is an on/off switch that can be toggled by the user and is used when presenting options that are not mutually exclusive?

CheckBox

48
New cards

Which control is an on/off button with a light indicator?

ToggleButton

49
New cards

Which control has two states (checked or unchecked) and is often grouped with others in a RadioGroup?

RadioButton

50
New cards

Which control is used to group together one or more RadioButtons?

RadioGroup

51
New cards

Which view provides visual feedback about ongoing tasks, such as when performing a task in the background?

ProgressBar

52
New cards

Which control is a drop‑down list that allows users to select one value from a set?

Spinner

53
New cards

Which view enables users to select a time of day, either in 24‑hour or AM/PM mode?

TimePicker

54
New cards

Which view enables users to select a date?

DatePicker

55
New cards

In Android, an event listener is an interface in the View class that contains a single ______ method.

callback

56
New cards

When a registered View is triggered by user interaction, the Android framework calls the methods in the event ______.

listener

57
New cards

When an event occurs and an event listener has been registered, the listener calls the event ______ method that handles the event.

handler

58
New cards

An Android ______ is an abstract description of an operation to be performed and can start activities, broadcast messages, or communicate with services.

Intent

59
New cards

Which method would you use to launch an Activity using an Intent?

startActivity

60
New cards

Which method sends an Intent to interested BroadcastReceiver components?

broadcastIntent

61
New cards

Which method can you use to communicate with a background Service using an Intent?

startService(Intent)

62
New cards

The Intent object is a passive data structure holding an ______ description of an operation to be performed.

abstract

63
New cards

Explicit intents are used to connect components within the same application, such as connecting one ______ to another.

activity

64
New cards

Implicit intents do not name a target; the ______ field is left blank and they are used to activate components in other applications.

component name

65
New cards

To add data into an Intent, you use the methods putExtra() or ______().

putExtras

66
New cards

The key‑value pairs stored in an Intent are known as ______.

extras

67
New cards

To retrieve extra data attached to an Intent in the target activity, call ______ on the Intent.

getExtras()

68
New cards

A ______ is a mapping from String keys to parcelable values that can be passed through an Intent.

Bundle

69
New cards

Which method do you use on the target activity to get the attached Bundle from an Intent?

getExtras()

70
New cards

To pass a Java object like an ArrayList or HashMap through a Bundle, the object must be ______.

serialized

71
New cards

To put a serializable object into a Bundle, use ______('KEY', OBJECT).

putSerializable

72
New cards

To retrieve a serialized object from a Bundle in the target activity, call ______('KEY', DEFAULT) and cast it to the appropriate type.

getSerializable

73
New cards

A ______ provides simple feedback about an operation in a small popup that disappears after a timeout.

Toast

74
New cards

When you create a toast, you call makeText() with three parameters: the application ______, the text message and the ______.

"Context duration"

75
New cards

After creating a Toast object, you display it by calling ______.

show()

76
New cards

A standard toast appears near the bottom of the screen, centered horizontally, but you can change its position using ______(int, int, int).

setGravity

77
New cards

In Android, a ______ is a message you can display to the user outside of your app's normal UI and it first appears as an icon in the notification area.

notification

78
New cards

To see the details of a notification, the user opens the ______.

notification drawer

79
New cards

Beginning with Android 5.0, notifications can appear in a floating window called a ______ notification.

heads-up

80
New cards

Heads‑up notifications are normally used for ______ notifications that the user should know about immediately.

important

81
New cards

Heads‑up notifications appear only if the device is ______.

unlocked

82
New cards

Starting with Android 5.0, notifications can appear on the ______ screen.

lock

83
New cards

You can control the level of detail and visibility of your app's notifications on the ______ screen.

lock

84
New cards

On devices running Android 8.0 or higher, app icons indicate new notifications with a colored ______ (notification dot).

badge

85
New cards

On supported launchers, users can ______ an app icon to see its notifications and act on them.

long-press

86
New cards

The design of a notification is determined by system ______; your app defines the content for each portion.

templates

87
New cards

In Android Studio projects, you should verify that your module-level build.gradle file includes the dependency for ______.

NotificationCompat

88
New cards

To set a notification's content and channel, you use a ______ object.

NotificationCompat.Builder

89
New cards

Which method on NotificationCompat.Builder sets the small icon for a notification?

setSmallIcon()

90
New cards

Which method on NotificationCompat.Builder sets the notification's title?

setContentTitle()

91
New cards

Which method on NotificationCompat.Builder sets the notification's body text?

setContentText()

92
New cards

Which method sets the notification's priority for Android 7.1 and lower?

setPriority()

93
New cards

The NotificationCompat.Builder constructor requires a ______ ID for compatibility with Android 8.0 and higher.

channel

94
New cards

By default, notification text is truncated to fit one line; to enable a longer notification you can add a style template with ______().

setStyle

95
New cards

On Android 8.0 and higher, before delivering a notification you must register your app's notification ______ with the system.

channel

96
New cards

The NotificationChannel constructor requires an ______ parameter from NotificationManager.

importance

97
New cards

On Android 7.1 and lower, you set the notification's ______ using setPriority().

priority

98
New cards

Although you must set notification importance and priority, the system may change it and the ______ can redefine it.

user

99
New cards

Every notification should respond to a tap by specifying a content intent with a ______ and passing it to setContentIntent().

PendingIntent

100
New cards

If an activity exists exclusively for responses to a notification, it should start a ______ task instead of being added to the existing back stack.

new