Google Associate-Android-Developer Associate Android Developer Exam Practice Test

Page: 1 / 14
Total 128 questions
Question 1

The easiest way of adding menu items (to specify the options menu for an activity) is inflating an XML file into the Menu via MenuInflater. With menu_main.xml we can do it in this way:



Question 2

In general, you should send an AccessibilityEvent whenever the content of your custom view changes. For example, if you are implementing a custom slider bar that allows a user to select a numeric value by pressing the left or right arrows, your custom view should emit an event of type TYPE_VIEW_TEXT_CHANGED whenever the slider value changes. Which one of the following sample codes demonstrates the use of the sendAccessibilityEvent() method to report this event.



Question 3

What happens when you create a DAO method and annotate it with @Insert?

Example:

@Dao

interface MyDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)

fun insertUsers(vararg users: User)

}



Answer : A


Question 4

For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:

android:title="@string/pref_sort_title" android:summary="@string/pref_sort_summary" android:dialogTitle="@string/pref_sort_dialog_title" android:entries="@array/sort_oder" android:entryValues="@array/sort_oder_value" android:defaultValue="@string/pref_default_sort_value" app:iconSpaceReserved="false" />

In our Fragment, we can dynamically get current notification preference value in this way:



Answer : D


Question 5

For example, we have a BufferedReader reader, associated with the json file through

InputStreamReader. To get a file data we can do this:



Answer : A


Question 6

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



Question 7

What is illustrated in the picture?



Answer : E


Page:    1 / 14   
Total 128 questions