Get Google Associate-Android-Developer Dumps Questions [2021] To Gain Brilliant Result
Associate-Android-Developer dumps - CertkingdomPDF - 100% Passing Guarantee
NEW QUESTION 62
What do you want from Room when you create a DAO method and annotate it with @Delete?
Example:
@Dao
interface MyDao {
@Delete
fun deleteUsers(vararg users: User)
}
- A. Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
- B. Room modifies a set of entities, given as parameters, in the database. It uses a query that matches against the primary key of each entity.
- C. Room generates an implementation that inserts all parameters into the database in a single transaction.
Answer: A
NEW QUESTION 63
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 all tests in Project, open the Project window, and then right-click a test and click Run .
- B. To test all methods in a class, right-click a class or method in the test file and click Run .
- C. To run a single test, open the Project window, and then right-click a test and click Run .
- D. To run all tests in a directory, right-click on the directory and select Run tests .
Answer: B,C,D
NEW QUESTION 64
Each time your test invokes onView(), Espresso waits to perform the corresponding UI action or assertion until the following synchronization conditions are met: (Choose three.)
- A. Some developer-defined idling resources are not idle.
- B. The message queue is empty.
- C. All developer-defined idling res
- D. The message queue is not empty.
- E. There are no instances of AsyncTask currently executing a task.
- F. There are some instances of AsyncTask currently executing a task.
Answer: B,C,E
NEW QUESTION 65
In application theme style, value statusBarColor (<item name="android:statusBarColor">) means:
- A. 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). - B. 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). - C. 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). - D. Color of text (usually same as colorForeground).
Answer: B
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/look-and-feel/themes https://developer.android.com/reference/android/R.styleable.html
NEW QUESTION 66
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. evaluate an expression at the current execution point
- B. continue running the app normally
- C. advance to the next line outside the current method
- D. advance to the first line inside a method call
- E. examine the object tree for a variable; expand it in the Variables view.
- F. advance to the next line in the code (without entering a method)
Answer: F
NEW QUESTION 67
What is demonstrated by the code below?
// RawDao.kt
@Dao
interface RawDao {
@RawQuery
fun getUserViaQuery(query: SupportSQLiteQuery?): User?
}
// Usage of RawDao
...
val query =
SimpleSQLiteQuery("SELECT * FROM User WHERE id = ? LIMIT 1",
arrayOf<Any>(sortBy))
val user = rawDao.getUserViaQuery(query)
...
- A. A method in a RoomDatabase class as a query method.
- B. A method in a Dao annotated class as a query method.
- C. A method in a Dao annotated class as a raw query method where you can pass the query as a SupportSQLiteQuery.
Answer: C
NEW QUESTION 68
Custom duration in milliseconds as a parameter for the setDuration method is available when you are working with:
- A. for none of them
- B. for both of them
- C. Snackbar
- D. Toast
Answer: C
NEW QUESTION 69
Select four different types of app components. (Choose four.)
- A. WorkManager
- B. Activities
- C. Application
- D. Content providers
- E. Services
- F. Fragments
- G. Layouts
- H. Broadcast receivers
- I. AlarmManager
Answer: B,D,E,H
NEW QUESTION 70
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:
...
<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. Never place this item in the app bar. Instead, list the item in the app bar's overflow menu.
- B. 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.
- C. The action view associated with this action item (as declared by android:actionLayout or android:actionViewClass) is collapsible.
- D. 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.
- E. 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.
Answer: A
Explanation:
Reference:
https://developer.android.com/guide/topics/ui/menus
NEW QUESTION 71
Enable debugging on your device: If you are using the emulator, this is enabled by default. But for a connected device, you need to
- A. enable transfer data from the device in usb connection options.
- B. enable connection in bluetooth options.
- C. enable debugging in the device developer options.
Answer: C
NEW QUESTION 72
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 (<selector> element )
- B. A Layer List (<layer-list> element) with items android:id="@+id/progress" and android:id="@+id/ background" inside it.
- C. An <ImageView> element with android:id="@+id/progress" identifier
Answer: B
Explanation:
Reference:
https://developer.android.com/guide/topics/resources/drawable-resource
NEW QUESTION 73
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_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)
- B. KEEP (existing work and ignore the new work)
- C. 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)
- D. REPLACE (existing work with the new work. This option cancels the existing work)
- E. 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)
- F. APPEND_OR_DESTROY (if no any work exists, the new work will be ignored)
- 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,D,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 74
Under the hood WorkManager uses an underlying job dispatching service based on the following criteri a. You need to move services to the correct places.
Answer:
Explanation:
Explanation:
Videos:
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 75
What do you want from Room when you create a DAO method and annotate it with @Delete?
Example:
@Dao
public interface MyDao {
@Delete
public void deleteUsers(User... users);
}
- A. Room removes a set of entities, given as parameters, from the database. It uses the primary keys to find the entities to delete.
- B. Room modifies a set of entities, given as parameters, in the database. It uses a query that matches against the primary key of each entity.
- C. Room generates an implementation that inserts all parameters into the database in a single transaction.
Answer: A
NEW QUESTION 76
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 no matching UI element is found, a UiAutomatorObjectNotFoundException is thrown.
- B. If more than one matching element is found, the first matching element in the layout hierarchy is returned as the target UiObject.
- C. If more than one matching element is found, the last matching element in the layout hierarchy is returned as the target UiObject.
- D. If no matching UI element is found, an IOException is thrown.
Answer: A,B
NEW QUESTION 77
Android Tests. You can use the childSelector() method to nest multiple UiSelector instances. For example, the following code example shows how your test might specify a search to find the first ListView in the currently displayed UI, then search within that ListView to find a UI element with the text property Apps.
What is the correct sample?
- A. UiObject appItem = device.findObject(new UiSelector()
.className("android.widget.ListView")
.instance(0)
.childSelector(new UiSelector()
.text("Apps"))); - B. UiObject appItem = device.findObject(new UiSelector()
.className("android.widget.ListView")
.instance(new UiSelector()
.text("Apps"))); - C. UiObject appItem = device.findObject(new UiSelector()
.className(ListView.class)
.instance(1)
.childSelector(new UiSelector()
.text("Apps")));
Answer: A
NEW QUESTION 78
When your code execution reaches the breakpoint, Android Studio pauses execution of your app. You can
- A. continue running the app normally
- B. advance to the next line in the code (without entering a method)
- C. advance to the next line outside the current method
- D. advance to the first line inside a method call
- E. evaluate an expression at the current execution point
- F. examine the object tree for a variable; expand it in the Variables view
Answer: E
NEW QUESTION 79
Under the hood WorkManager uses an underlying job dispatching service based on the following criteri a. You need to move services to the correct places.
Answer:
Explanation:
Explanation:
Videos:
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 80
An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an instance of our Repository, named mRepository. Our ViewModel has such constructor:
public MyViewModel(MyRepository myRepository)...
Next, in our ViewModelFactory create ViewModel method (overriden) looks like this:
@NonNull
@Override
public <T extends ViewModel> T create(@NonNull Class<T> modelClass) { try {
//MISSED RETURN VALUE HERE
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException("Cannot create an instance of " + modelClass, e);
}
}
What should we write instead of "//MISSED RETURN VALUE HERE"?
- A. return modelClass.getConstructor(MyRepository.class)
.newInstance(mRepository); - B. return modelClass.getConstructor(MyRepository.class)
.newInstance(); - C. return modelClass.getConstructor()
.newInstance(mRepository);
Answer: A
NEW QUESTION 81
Which statement is most true about layout_constraintLeft_toRightOf and layout_constraintStart_toEndOf constraints ?
- A. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in case if user choose a language that uses left-to-right (LTR) scripts, such as English or French, for their UI locale
- B. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in any case
- C. layout_constraintLeft_toRightOf is equal to layout_constraintStart_toEndOf in case if user choose a language that uses right-to-left (RTL) scripts, such as Arabic or Hebrew, for their UI locale
- D. layout_constraintLeft_toRightOf works with horizontal axes and layout_constraintStart_toEndOf works with vertical axes
Answer: A
Explanation:
Reference:
https://developer.android.com/training/basics/supporting-devices/languages
NEW QUESTION 82
For example, our preferences.xml file was added by addPreferencesFromResource (R.xml.preferences). Our preferences.xml file contains such item:
<SwitchPreference android:id="@+id/notification" android:key="@string/pref_notification_key" android:title="@string/pref_notification_title" android:summary="@string/pref_notification_summary" android:defaultValue="@bool/pref_notification_default_value" app:iconSpaceReserved="false"/> In our Fragment, we can dynamically get current notification preference value in this way:
- A. boolean isNotificationOn = PreferenceManager.getDefaultSharedPreferences(getContext ()).getBoolean( getContext().getString(R.string.pref_notification_key), getContext().getResources().getBoolean(R.bool.pref_notification_default_value) );
- B. boolean isNotificationOn = PreferenceManager.getSharedPreferences(getContext ()).getBoolean( getContext().getString(R.string.pref_notification_default_value), getContext().getString(R.string.pref_notification_key) );
- C. boolean isNotificationOn = PreferenceManager.getSharedPreferences(getContext ()).getBoolean( getContext().getResources().getBoolean(R.bool.pref_notification_default_value), getContext().getString(R.string.pref_notification_key) );
Answer: A
NEW QUESTION 83
@Query is the main annotation used in DAO classes. It allows you to perform read/write operations on a database. Each @Query method is verified at compile time, so what happens if there is a problem with the query?
- A. both compilation error and runtime failure occurs.
- B. a compilation error occurs instead of a runtime failure.
- C. a runtime error occurs instead of a compilation failure.
Answer: B
NEW QUESTION 84
Select 3 major components of the Room. (Choose three.)
- A. @RawQuery
- B. @WorkerThread
- C. @Database
- D. @Entity
- E. @DAO
- F. @Query
Answer: C,D,E
NEW QUESTION 85
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. evaluate an expression at the current execution point
- B. continue running the app normally
- C. advance to the next line in the code (without entering a method)
- D. advance to the next line outside the current method
- E. advance to the first line inside a method call
- F. examine the object tree for a variable, expand it in the Variables view. If the Variables view is not visible
Answer: E
NEW QUESTION 86
......
Get 100% Passing Success With True Associate-Android-Developer Exam: https://www.certkingdompdf.com/Associate-Android-Developer-latest-certkingdom-dumps.html