google associate android developer practice test

Associate Android Developer

Last exam update: Dec 03 ,2024
Page 1 out of 9. Viewing questions 1-15 out of 128

Question 1 Topic 2, JAVA only

Topic 2
Android uses adapters (from the Adapter class) to connect data with View items in a list. There are many different kinds of
adapters available, and you can also write custom adapters. To connect data with View items, the adapter needs to know
about the View items. From what is extended the entity that is usually used in an adapter and describes a View item and its
position within the RecyclerView?

  • A. RecyclerView.AdapterDataObserver
  • B. RecyclerView.ItemDecoration
  • C. RecyclerView.ViewHolder
  • D. RecyclerViewAccessibilityDelegate
Mark Question:
Answer:

C


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/layout/recyclerview

User Votes:
A 2 votes
50%
B 1 votes
50%
C 1 votes
50%
D 1 votes
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2 Topic 2, JAVA only

Topic 2
RecyclerView is a subclass of ViewGroup and is a more resource-efficient way to display scrollable lists. Instead of creating
a View for each item that may or may not be visible on the screen, RecyclerView:

  • A. creates a single list item and reuses it for visible content.
  • B. creates an unlimited number of list items and never reuses them
  • C. creates a limited number of list items and reuses them for visible content.
  • D. creates a single list item and never reuses it
Mark Question:
Answer:

C


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/layout/recyclerview

User Votes:
A 1 votes
50%
B 1 votes
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3 Topic 2, JAVA only

Topic 2
We have a custom view that extends android.widget.ProgressBar. Our progress bar is not touchable, focusable, etc.: it just
shows progress. Style for our custom progress bar extends Widget.AppCompat.ProgressBar.Horizontal. An item, named
progressDrawable, in our style, is a xml file . What we usually can see as a main single element in this xml file:

  • A. A State List ( element )
  • B. A Layer List ( element) with items android:id="@+id/progress" and android:id="@+id/background" inside it.
  • C. An element with android:id="@+id/progress" identifier
Mark Question:
Answer:

B


Explanation:
Reference:
https://developer.android.com/guide/topics/resources/drawable-resource

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 4 Topic 2, JAVA only

Topic 2
Working with Custom View. Once you define the custom attributes, you can use them in layout XML files just like built-in
attributes. The only difference is that your custom attributes belong to a different namespace. Instead of belonging to the
http://schemas.android.com/apk/res/android namespace, they belong to:

  • A. http://schemas.android.com/apk/res/[your package name]
  • B. http://schemas.android.com/apk/[your package name]
  • C. http://schemas.android.com/[your package name]
Mark Question:
Answer:

A


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/custom-components

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 5 Topic 2, JAVA only

Topic 2
Working with Custom View. To define custom attributes, we can add resources to our project. It is customary to put these
resources into a file:

  • A. res/layout/attrs.xml
  • B. res/values/attrs.xml
  • C. res/raw/attrs.xml
  • D. res/xml/attrs.xml
Mark Question:
Answer:

B


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/custom-components

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 6 Topic 2, JAVA only

Topic 2
To handle an options menu item click in an activity, we usually should override method named:

  • A. onKey
  • B. onClick
  • C. onOptionsItemSelected
Mark Question:
Answer:

C


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 7 Topic 2, JAVA only

Topic 2
For example, suppose that in a XML file (res/menu/menu_main.xml as an example), where menu items are described, we
have such item:
...
<>
android:id="@+id/action_settings" android:orderInCategory="100"
android:title="@string/menu_action_settings" app:showAsAction="never" />
...
Attribute app:showAsAction shows when and how this item should appear as an action item in the app bar. What value
never in this attribute means?

  • A. Only place this item in the app bar if there is room for it. If there is not room for all the items marked by this value, the items with the lowest orderInCategory values are displayed as actions, and the remaining items are displayed in the overflow menu.
  • B. Also include the title text (defined by android:title) with the action item. You can include this value along with one of the others as a flag set, by separating them with a pipe.
  • C. Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.
  • D. Always place this item in the app bar. Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the app bar.
  • E. The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.
Mark Question:
Answer:

C


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 8 Topic 2, JAVA only

Topic 2
An overridden method onCreateOptionsMenu in an Activity returns boolean value. What does this value mean?

  • A. You must return true for the menu to be displayed; if you return false it will not be shown.
  • B. You must return false for the menu to be displayed; if you return true it will not be shown.
  • C. You can return any value: the menu will be displayed anyway.
Mark Question:
Answer:

A


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 9 Topic 2, JAVA only

Topic 2
In application theme style, value statusBarColor () means:

  • A. Color of text (usually same as colorForeground).
  • B. Shows a thin line of the specified color between the navigation bar and the app content. For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation. Corresponds to Window.setNavigationBarDividerColor(int).
  • C. The color for the status bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the status bar must not have been requested to be translucent with R.attr.windowTranslucentStatus. Corresponds to Window.setStatusBarColor(int).
  • D. The color for the navigation bar. If the color is not opaque, consider setting View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION. For this to take effect, the window must be drawing the system bar backgrounds with R.attr.windowDrawsSystemBarBackgrounds and the navigation bar must not have been requested to be translucent with R.attr.windowTranslucentNavigation. Corresponds to Window.setNavigationBarColor(int).
Mark Question:
Answer:

C


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes
https://developer.android.com/reference/android/R.styleable.html

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10 Topic 2, JAVA only

Topic 2
In application theme style, flag windowDrawsSystemBarBackgrounds () indicates:

  • A. whether this window should have an Action Bar in place of the usual title bar.
  • B. whether there should be no title on this window.
  • C. that this window should not be displayed at all.
  • D. whether this is a floating window.
  • E. whether this Window is responsible for drawing the background for the system bars.
Mark Question:
Answer:

E


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes
https://developer.android.com/reference/android/R.styleable.html

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 11 Topic 2, JAVA only

Topic 2
In application theme style, flag windowNoTitle () indicates:

  • A. whether this window should have an Action Bar in place of the usual title bar.
  • B. whether there should be no title on this window.
  • C. that this window should not be displayed at all.
  • D. whether this is a floating window.
  • E. whether this Window is responsible for drawing the background for the system bars.
Mark Question:
Answer:

B


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes
https://developer.android.com/reference/android/R.styleable.html

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 12 Topic 2, JAVA only

Topic 2
In application theme style, flag windowActionBar () indicates:

  • A. whether the given application component is available to other applications.
  • B. whether action modes should overlay window content when there is not reserved space for their UI (such as an Action Bar).
  • C. whether this window's Action Bar should overlay application content.
  • D. whether this window should have an Action Bar in place of the usual title bar.
Mark Question:
Answer:

D


Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes
https://developer.android.com/reference/android/R.styleable.html

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13 Topic 2, JAVA only

Topic 2
Content labels. What attribute to use to indicate that a View should act as a content label for another View?

  • A. android:contentDescription
  • B. android:hint
  • C. android:labelFor
Mark Question:
Answer:

C


Explanation:
Reference:
https://support.google.com/accessibility/android/answer/7158690?hl=en

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 14 Topic 2, JAVA only

Topic 2
When using an EditTexts or editable TextViews, or other editable View. What attribute to use to provide a content label for
that View?

  • A. android:contentDescription
  • B. android:hint
  • C. android:labelFor
Mark Question:
Answer:

B


Explanation:
Reference:
https://support.google.com/accessibility/android/answer/7158690?hl=en

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 15 Topic 2, JAVA only

Topic 2
When using an ImageView, ImageButton, CheckBox, or other View that conveys information graphically. What attribute to
use to provide a content label for that View?

  • A. android:contentDescription
  • B. android:hint
  • C. android:labelFor
Mark Question:
Answer:

A


Explanation:
Reference:
https://support.google.com/accessibility/android/answer/7158690?hl=en

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000
To page 2