[Dec-2021] Updated Google Associate-Android-Developer Dumps – PDF & Online Engine
Associate-Android-Developer.pdf - Questions Answers PDF Sample Questions Reliable
User interface
- Building a UI with a ConstraintLayout,
- Knowing how to show items in a RecyclerView by the Paging library and binding local data.
- Describing how to build a custom View class and include it in a Layout.
- Creating an Activity that shows the Layout
- Adding accessibility hooks to a custom View.
- Describing the Android operation lifecycle.
- Knowing how to make a custom app theme.
- Understanding how to use menu-based and drawer navigation.
- Understanding how to use content descriptions to make views more available.
NEW QUESTION 22
If you want to access a specific UI component in an app, use the UiSelector class. This class represents a query for specific elements in the currently displayed UI. What is correct about it? (Choose two.)
- A. If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target UiObject.
- B. If more than one matching element is found, the last matching element in the layout hierarchy is returned as the target UiObject.
- C. If no matching UI element is found, a UiAutomatorObjectNotFoundException is thrown.
- D. If no matching UI element is found, an IOException is thrown.
Answer: A,C
NEW QUESTION 23
A class that you create for managing multiple data sources. In addition to a Room database, this class could manage remote data sources such as a web server. It is about:
- A. Repository
- B. ViewModel
- C. Activity/Fragment
- D. Room database
Answer: A
NEW QUESTION 24
When scheduling unique work, you must tell WorkManager what action to take when there is a conflict. You do this by passing an enum when enquing the work. For one-time work, you provide an ExistingWorkPolicy, which supports some options for handling the conflict. (Choose four.)
- A. APPEND_AND_RUN (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is PAUSED, the new work still runs)
- B. REPLACE (existing work with the new work. This option cancels the existing work)
- C. KEEP (existing work and ignore the new work)
- D. APPEND_OR_KEEP (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still not runs)
- E. APPEND_OR_DESTROY (if no any work exists, the new work will be ignored)
- F. APPEND_OR_REPLACE (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still runs)
- G. DESTROY (if any work exists, the new work will be ignored)
- H. APPEND (the new work to the end of the existing work. This policy will cause your new work to be chained to the existing work, running after the existing work finishes)
Answer: B,C,F,H
Explanation:
Working with WorkManager, from the 2018 Android Dev Summit WorkManager: Beyond the basics, from the 2019 Android Dev Summit Reference:
https://developer.android.com/reference/androidx/work/WorkManager?hl=en
NEW QUESTION 25
If you are working with a Builder that creates a PeriodicWorkRequest to run periodically once within the flex period of every interval period. What statement is correct?
- A. The repeat interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval can be anything in relation to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.
- B. The repeat interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be greater than or equal to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.
- C. The repeat interval must be lower than or equal to PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be lower than or equal to PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.
- D. The repeat interval must be greater than PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS and the flex interval must be greater than PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS.
Answer: B
Explanation:
Working with WorkManager, from the 2018 Android Dev Summit
WorkManager: Beyond the basics, from the 2019 Android Dev Summit
Reference:
https://developer.android.com/reference/androidx/work/WorkManager?hl=en
NEW QUESTION 26
Working with Custom View. To define custom attributes, we can add <declare-styleable> resources to our project. It is customary to put these resources into a file:
- A. res/values/attrs.xml
- B. res/raw/attrs.xml
- C. res/layout/attrs.xml
- D. res/xml/attrs.xml
Answer: A
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/custom-components
NEW QUESTION 27
To create a basic JUnit 4 test class, create a class that contains one or more test methods. A test method begins with the specific annotation and contains the code to exercise and verify a single functionality in the component that you want to test. What is the annotation?
- A. @Rule
- B. @RunWith
- C. @LargeTest
- D. @Test
Answer: D
NEW QUESTION 28
What is illustrated in the picture?
- A. Debugging native code using LLDB
- B. The Breakpoints window lists all the current breakpoints and includes behavior settings for each
- C. Logcat window with filter settings
- D. The Variables and Watches panes in the Debugger window
- E. Adding a watchpoint to a variable in memory
Answer: D
NEW QUESTION 29
SharedPreferences.Editor is an interface used for modifying values in a SharedPreferences object. To mark in the editor that a preference value should be removed, which will be done in the actual preferences once commit() or apply() is called, what method in SharedPreferences.Editor should we use?
- A. delete(String key)
- B. removeAll()
- C. remove(String key)
- D. clear()
Answer: D
Explanation:
clear() method marks in the editor to remove ALL values from the preferences. Once commit is called, the only remaining preferences will be any that you have defined in this editor.
And no delete and removeAll method exists in SharedPreferences.Editor
NEW QUESTION 30
The following code snippet shows an example of an Espresso test:
- A. @Rule
fun greeterSaysHello() {
onView(withId(R.id.name_field)).do(typeText("Steve"))
onView(withId(R.id.greet_button)).do(click())
onView(withText("Hello Steve!")).check(matches(isDisplayed()))
} - B. @Test
fun greeterSaysHello() {
onView(withId(R.id.name_field)).do(typeText("Steve"))
onView(withId(R.id.greet_button)).do(click())
onView(withText("Hello Steve!")).compare(matches(isDisplayed()))
} - C. @Test
fun greeterSaysHello() {
onView(withId(R.id.name_field)).perform(typeText("Steve"))
onView(withId(R.id.greet_button)).perform(click())
onView(withText("Hello Steve!")).check(matches(isDisplayed()))
}
Answer: C
NEW QUESTION 31
By executing an allowMainThreadQueries() method to the room database builder RoomDatabase.Builder, we can:
- A. set the database factory
- B. handle database first time creation
- C. disable the main thread query check for Room
- D. handle database opening
Answer: C
NEW QUESTION 32
To run your local unit tests, follow these steps:
1. Be sure your project is synchronized with Gradle by clicking Sync Project in the toolbar.
2. Run your test in one of the following ways (select possible): (Choose three.)
- A. To run a single test, open the Project window, and then right-click a test and click Run .
- B. To run all tests in a directory, right-click on the directory and select Run tests .
- C. To run all tests in Project, open the Project window, and then right-click a test and click Run .
- D. To test all methods in a class, right-click a class or method in the test file and click Run .
Answer: A,B,D
NEW QUESTION 33
For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:
<ListPreference android:id="@+id/order_by" android:key="@string/pref_sort_key" 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:
- A. val sortBy = PreferenceManager.getDefaultSharedPreferences(context).getString( context!!.getString(R.string.pref_sort_key), context!!.getString(R.string.pref_default_sort_value) )
- B. val sortBy = PreferenceManager.getSharedPreferences(context).getBoolean( context!!.resources.getBoolean(R.bool.pref_default_sort_value), context!!.getString(R.string.pref_sort_key) )
- C. val sortBy = PreferenceManager.getDefaultSharedPreferences(context).getString( context!!.getString(R.string.pref_sort_key), context!!.resources.getBoolean(R.bool.pref_default_sort_value) )
- D. val sortBy = PreferenceManager.getSharedPreferences(context).getString( context!!.getString(R.string.pref_default_sort_value), context!!.getString(R.string.pref_sort_key), )
Answer: A
NEW QUESTION 34
If content in a PagedList updates, the PagedListAdapter object receives:
- A. one or more items from PagedList that contains the updated information.
- B. only one item from PagedList that contains the updated information.
- C. a completely new PagedList that contains the updated information.
Answer: C
Explanation:
Reference:
https://developer.android.com/topic/libraries/architecture/paging/ui
NEW QUESTION 35
For example, we have a file in our assets folder app/src/main/assets/sample_teas.json. To get an InputStream for reading it, from out Context context, we can try doing this:
- A. InputStream input = context.getResources().openRawResource(R.raw.sample_teas);
- B. InputStream input = context.getAssets().open("sample_teas.json");
- C. InputStream input = context.getResources().getAssets().open ("sample_teas.json");
Answer: B
NEW QUESTION 36
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can then use the tools in the Debugger tab to identify the state of the app. With Step Into you can
- A. continue running the app normally
- B. advance to the next line in the code (without entering a method)
- C. evaluate an expression at the current execution point
- D. advance to the first line inside a method call
- E. advance to the next line outside the current method
- F. examine the object tree for a variable, expand it in the Variables view. If the Variables view is not visible
Answer: D
NEW QUESTION 37
The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Medium tests are integration tests that:
- A. validate your app's behavior one class at a time.
- B. validate user journeys spanning multiple modules of your app.
- C. validate either interactions between levels of the stack within a module, or interactions between related modules.
Answer: C
NEW QUESTION 38
In application theme style, flag windowDrawsSystemBarBackgrounds (<item name="android:windowDrawsSystemBarBackgrounds">) indicates:
- A. whether this Window is responsible for drawing the background for the system bars.
- B. whether this is a floating window.
- C. whether there should be no title on this window.
- D. whether this window should have an Action Bar in place of the usual title bar.
- E. that this window should not be displayed at all.
Answer: A
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html
NEW QUESTION 39
Once your test has obtained a UiObject object, you can call the methods in the UiObject class to perform user interactions on the UI component represented by that object. You can specify such actions as: (Choose four.)
- A. touch() : Touch the center of the visible bounds of the UI element.
- B. setText() : Sets the text in an editable field, after clearing the field's content. Conversely, the clearTextField() method clears the existing text in an editable field.
- C. moveTo() : Move this object to arbitrary coordinates.
- D. click() : Clicks the center of the visible bounds of the UI element.
- E. dragTo() : Drags this object to arbitrary coordinates.
- F. swipeUp() : Performs the swipe up action on the UiObject. Similarly, the swipeDown(), swipeLeft(), and swipeRight() methods perform corresponding actions.
Answer: B,D,E,F
NEW QUESTION 40
Which build options in the Build menu to choose to delete all intermediate/cached build files.
- A. Generate Signed Bundle / APK
- B. Make Module
- C. Rebuild Project
- D. Clean Project
- E. Make Project
Answer: D
Explanation:
Reference:
https://developer.android.com/studio/run
NEW QUESTION 41
By adding a RoomDatabase.Callback to the room database builder RoomDatabase.Builder (method addCallback(RoomDatabase.Callback callback)), we can: (Choose two.)
- A. handle database opening
- B. set the database factory
- C. disable the main thread query check for Room
- D. handle database first time creation
Answer: A,D
NEW QUESTION 42
In a class PreferenceFragmentCompat. What method is called during onCreate(Bundle) to supply the preferences for this fragment. And where subclasses are expected to call setPreferenceScreen (PreferenceScreen) either directly or via helper methods such as addPreferencesFromResource (int)?
- A. onCreateLayoutManager
- B. onCreateRecyclerView
- C. onCreatePreferences
- D. onCreateView
Answer: C
NEW QUESTION 43
To run a debuggable build variant you must use a build variant that includes
- A. minifyEnabled false in the build configuration
- B. debuggable true in the build configuration
- C. debuggable true or debuggable false in the build configuration
Answer: B
NEW QUESTION 44
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can then use the tools in the Debugger tab to identify the state of the app. With Step Over you can
- A. continue running the app normally
- B. advance to the first line inside a method call
- C. advance to the next line in the code (without entering a method)
- D. evaluate an expression at the current execution point
- E. advance to the next line outside the current method
- F. examine the object tree for a variable; expand it in the Variables view.
Answer: C
NEW QUESTION 45
About queries in DAO classes. Room verifies the return value of the query such that if the name of the field in the returned object doesn't match the corresponding column names in the query response, Room alerts you in one of the following two ways: (Choose two.)
- A. It gives a warning if no field names match.
- B. It gives an error if only some field names match.
- C. It gives a warning if only some field names match.
- D. It gives an error if no field names match.
Answer: C,D
NEW QUESTION 46
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:
- A. @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
} - B. @Override
public boolean onOptionsItemSelected(MenuItem item) {
getMenuInflater().inflate(R.menu.menu_main, menu); return super.onOptionsItemSelected(item);
} - C. @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.menu.menu_main);
}
Answer: A
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus
NEW QUESTION 47
......
Google Associate-Android-Developer Dumps PDF Are going to be The Best Score: https://www.passcollection.com/Associate-Android-Developer_real-exams.html

