Deck 7: Reveal Displaying Pictures in a Gallery

Full screen (f)
exit full mode
Question
Arrays provide access to data by using a numeric ____ to identify each element in the array.

A) counter
C) position
B) index
D) threshold
Use Space or
up arrow
down arrow
to flip the card.
Question
If you provide different resolutions of images to the Android system, you will have to manually select the correct resolution for a given system.
Question
Typically a(n) ____ is used to assign values to a Gallery control that has multiple items.

A) array
C) integer
B) boolean
D) String
Question
____ variables can be accessed from anywhere within the Java class in which they are declared.

A) Automatic
C) Local-level
B) Class-level
D) Temporary
Question
You can only scroll in one direction using the Gallery.
Question
When you add a new class that extends a base class, the methods that need implementation are auto-generated.
Question
A View represents a piece of the screen area that displays an object.
Question
If you want to use a Toast notification in an Activity that is the main Activity, you should use the Main.this reference as the correct Context.
Question
The length of an array is one more than the maximum subscript number.
Question
The ____ layout tool shows items in a center-locked, horizontally scrolling list.

A) Gallery
C) MediaPlayer
B) ImageViewer
D) TextView
Question
The first Gallery control in a project is named ____ by default.

A) control1
C) gallery1
B) defaultGallery
D) theGallery
Question
A(n) ____ container is a rectangular area of the screen that displays am image or text object.

A) Expanse
C) Space
B) Layout
D) View
Question
Images are a powerful marketing tool and add visual appeal to your application.
Question
If you wish, you can scale the Gallery images to full size of the screen.
Question
A Gallery of images is not very useful for selecting wallpaper images because of the large number of options.
Question
Typically you add an ImageView control by dragging the control onto the ____.

A) emulator
C) Palette
B) Gallery
D) XML code
Question
Using controls such as the Gallery and Spinner, a(n) ____ binds specific types of data and displays that data in a particular layout.

A) adapter
C) editor
B) context
D) view
Question
The ____ control displays items in a two-dimensional, scrollable grid.

A) Box
C) Swatch
B) GridView
D) Wallpaper
Question
The Gallery control is the only one that monitors for click events.
Question
The Gallery control is a widget that sits in the ____ category of the palette.

A) Images
C) Media
B) Images & Media
D) Viewing
Question
The method to set an image to an ImageView control is ____________________.
Question
The ____ method provides a number of arguments to its registered listeners.

A) beenClicked
C) onClick
B) clicked
D) onItemClick
Question
The ____ is the fractional relation of the width of an image compared with its height.

A) aspect ratio
C) scaling ratio
B) framing ratio
D) x-to-y ratio
Question
A common aspect ratio is ____.

A) 4:3
C) 16:8
B) 3:4
D) 10:6
Question
The code to reference an image called panda. png is ____________________.
Question
The ____ statement returns the value from a method.

A) if
C) return
B) for
D) while
Question
You declare a method's return type in its ____.

A) body
C) last line
B) declaration
D) name
Question
When the ImageAdapter class is called, the ____ method determines how many pictures should be displayed in the Gallery control.

A) count()
C) getNumber()
B) getCount()
D) getSize()
Question
The return type of a method that returns nothing is ____.

A) double
C) String
B) int
D) void
Question
In the onItemClick method, the variable that holds the actual View that was selected is the ____ argument.

A) first
C) third
B) second
D) fourth
Question
Users can quickly scroll the image Gallery by ____________________ their fingers.
Question
A(n) ____ variable is used to load and access resources for the application.

A) App
C) Program
B) Context
D) System
Question
The Toast class is part of the android.____ package.

A) context
C) layout
B) controls
D) widget
Question
In the onItemClick method, the variable that holds the position of the View in the Adapter is ____ argument.

A) first
C) third
B) second
D) fourth
Question
The last argument to the onItemClick method determines the row id of the selected item, which is most useful for a ____.

A) GridView
C) Spinner
B) ListView
D) TextView
Question
The scaling option that scales an image to fit the View type is ImageView.ScaleType.____.

A) CENTER
C) FIT_SIZE
B) CENTER_CROP
D) FIT_XY
Question
The ____________________ method provides the data model for the Gallery layout.
Question
In Android programs, you can place the ____________________ method in another method that is triggered only when the user touches the Gallery control.
Question
A(n) ____ return type indicates that the return type of a method is an integer.

A) char
C) int
B) double
D) number
Question
The scaling option that does not change the aspect ratio of an image is ImageView.ScaleType.____.

A) CENTER
C) FIT_SIZE
B) CENTER_CROP
D) FIT_XY
Question
A(n) ____________________ is a series of statements that perform some repeated task.
Question
The most powerful method in the ImageAdapter class is the ____________________ method.
Question
Keeping the ____________________ means that an image is not distorted from its original ratio of width to height .
Question
The code to return the length of a String variable called butter is ____________________.
Question
The code to resize an image variable pic to 275x200 is ____________________.
Question
____________________ are used to initialize the instance variables of an object.
Question
The code to find the size of an array called bananas is ____________________.
Question
The method to scale an ImageView a certain way is ____________________.
Question
To set an image on the surface of a Button control, you can set the ____________________ attribute in the XML code.
Question
The Context class is in the ____________________ package.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 7: Reveal Displaying Pictures in a Gallery
1
Arrays provide access to data by using a numeric ____ to identify each element in the array.

A) counter
C) position
B) index
D) threshold
B
2
If you provide different resolutions of images to the Android system, you will have to manually select the correct resolution for a given system.
False
3
Typically a(n) ____ is used to assign values to a Gallery control that has multiple items.

A) array
C) integer
B) boolean
D) String
A
4
____ variables can be accessed from anywhere within the Java class in which they are declared.

A) Automatic
C) Local-level
B) Class-level
D) Temporary
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
You can only scroll in one direction using the Gallery.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
When you add a new class that extends a base class, the methods that need implementation are auto-generated.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
A View represents a piece of the screen area that displays an object.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
If you want to use a Toast notification in an Activity that is the main Activity, you should use the Main.this reference as the correct Context.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
The length of an array is one more than the maximum subscript number.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
The ____ layout tool shows items in a center-locked, horizontally scrolling list.

A) Gallery
C) MediaPlayer
B) ImageViewer
D) TextView
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The first Gallery control in a project is named ____ by default.

A) control1
C) gallery1
B) defaultGallery
D) theGallery
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
A(n) ____ container is a rectangular area of the screen that displays am image or text object.

A) Expanse
C) Space
B) Layout
D) View
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
Images are a powerful marketing tool and add visual appeal to your application.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
If you wish, you can scale the Gallery images to full size of the screen.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
A Gallery of images is not very useful for selecting wallpaper images because of the large number of options.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
Typically you add an ImageView control by dragging the control onto the ____.

A) emulator
C) Palette
B) Gallery
D) XML code
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Using controls such as the Gallery and Spinner, a(n) ____ binds specific types of data and displays that data in a particular layout.

A) adapter
C) editor
B) context
D) view
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ control displays items in a two-dimensional, scrollable grid.

A) Box
C) Swatch
B) GridView
D) Wallpaper
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
The Gallery control is the only one that monitors for click events.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
The Gallery control is a widget that sits in the ____ category of the palette.

A) Images
C) Media
B) Images & Media
D) Viewing
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
The method to set an image to an ImageView control is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
The ____ method provides a number of arguments to its registered listeners.

A) beenClicked
C) onClick
B) clicked
D) onItemClick
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
The ____ is the fractional relation of the width of an image compared with its height.

A) aspect ratio
C) scaling ratio
B) framing ratio
D) x-to-y ratio
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
A common aspect ratio is ____.

A) 4:3
C) 16:8
B) 3:4
D) 10:6
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The code to reference an image called panda. png is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
The ____ statement returns the value from a method.

A) if
C) return
B) for
D) while
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
You declare a method's return type in its ____.

A) body
C) last line
B) declaration
D) name
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
When the ImageAdapter class is called, the ____ method determines how many pictures should be displayed in the Gallery control.

A) count()
C) getNumber()
B) getCount()
D) getSize()
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
The return type of a method that returns nothing is ____.

A) double
C) String
B) int
D) void
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
In the onItemClick method, the variable that holds the actual View that was selected is the ____ argument.

A) first
C) third
B) second
D) fourth
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
Users can quickly scroll the image Gallery by ____________________ their fingers.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
A(n) ____ variable is used to load and access resources for the application.

A) App
C) Program
B) Context
D) System
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The Toast class is part of the android.____ package.

A) context
C) layout
B) controls
D) widget
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
In the onItemClick method, the variable that holds the position of the View in the Adapter is ____ argument.

A) first
C) third
B) second
D) fourth
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
The last argument to the onItemClick method determines the row id of the selected item, which is most useful for a ____.

A) GridView
C) Spinner
B) ListView
D) TextView
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
The scaling option that scales an image to fit the View type is ImageView.ScaleType.____.

A) CENTER
C) FIT_SIZE
B) CENTER_CROP
D) FIT_XY
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
The ____________________ method provides the data model for the Gallery layout.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
In Android programs, you can place the ____________________ method in another method that is triggered only when the user touches the Gallery control.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ return type indicates that the return type of a method is an integer.

A) char
C) int
B) double
D) number
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The scaling option that does not change the aspect ratio of an image is ImageView.ScaleType.____.

A) CENTER
C) FIT_SIZE
B) CENTER_CROP
D) FIT_XY
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
A(n) ____________________ is a series of statements that perform some repeated task.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
The most powerful method in the ImageAdapter class is the ____________________ method.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Keeping the ____________________ means that an image is not distorted from its original ratio of width to height .
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
The code to return the length of a String variable called butter is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
The code to resize an image variable pic to 275x200 is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
____________________ are used to initialize the instance variables of an object.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
The code to find the size of an array called bananas is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
The method to scale an ImageView a certain way is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
To set an image on the surface of a Button control, you can set the ____________________ attribute in the XML code.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The Context class is in the ____________________ package.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 50 flashcards in this deck.