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. dragTo() : Drags this object to arbitrary coordinates.
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. touch() : Touch the center of the visible bounds of the UI element.
D. moveTo() : Move this object to arbitrary coordinates.
E. click() : Clicks the center of the visible bounds of the UI element.
F. swipeUp() : Performs the swipe up action on the UiObject. Similarly, the swipeDown(), swipeLeft(), and swipeRight() methods perform corresponding actions.
正解:A,B,E,F
質問 2:
With a room database. When performing queries, you'll often want your app's UI to update automatically when the data changes. Can you use a return value of type LiveData in your query method description to achieve this?
A. No
B. Yes
正解:B
解説: (Pass4Test メンバーにのみ表示されます)
質問 3:
In our TeaViewModel class, that extends ViewModel, we have such prorerty:
val tea: LiveData<Tea>
An observer in our Activity (type of mViewModel variable in example is TeaViewModel) is set in this way:
mViewModel!!.tea.observe(this, Observer { tea: Tea? -> displayTea(tea) }) What will be a correct displayTea method definition?
A. private fun displayTea(tea: LiveData?<Tea>)
B. private fun displayTea()
C. private fun displayTea(tea: LiveData?<T>)
D. private fun displayTea(tea: Tea?)
正解:D
質問 4:
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.getSharedPreferences(getContext ()).getBoolean( getContext().getResources().getBoolean(R.bool.pref_notification_default_value), getContext().getString(R.string.pref_notification_key) );
B. boolean isNotificationOn = PreferenceManager.getDefaultSharedPreferences(getContext ()).getBoolean( getContext().getString(R.string.pref_notification_key), getContext().getResources().getBoolean(R.bool.pref_notification_default_value) );
C. boolean isNotificationOn = PreferenceManager.getSharedPreferences(getContext ()).getBoolean( getContext().getString(R.string.pref_notification_default_value), getContext().getString(R.string.pref_notification_key) );
正解:B
質問 5:
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
正解:B
質問 6:
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 test all methods in a class, right-click a class or method in the test file and click Run .
B. To run a single test, open the Project window, and then right-click a test and click Run .
C. To run all tests in Project, 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 .
正解:A,B,D
質問 7:
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);
}
正解:A
解説: (Pass4Test メンバーにのみ表示されます)
大森** -
全くの素人でしたが、無事一発合格することができました。
Pass4Testのおかげです。ありがとうございました。