DRAG DROP
Under the hood WorkManager uses an underlying job dispatching service based on the following criteria. You need to move services to the correct places.
Select and Place:
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)).perform(typeText("Steve"))
onView(withId(R.id.greet_button)).perform(click())
onView(withText("Hello Steve!")).check(matches(isDisplayed()))
}
C. @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()))
}
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 no matching UI element is found, an IOException is thrown.
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, a UiAutomatorObjectNotFoundException is thrown.
The Testing Pyramid, shown in the Figure, illustrates how your app should include the three categories of tests: small, medium, and large. Small tests are unit tests that :
A. validate your app's behavior one class at a time.
B. validate either interactions between levels of the stack within a module, or interactions between related modules.
C. validate user journeys spanning multiple modules of your app.
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. examine the object tree for a variable, expand it in the Variables view. If the Variables view is not visible
B. evaluate an expression at the current execution point
C. advance to the next line in the code (without entering a method)
D. advance to the first line inside a method call
E. advance to the next line outside the current method
F. continue running the app normally
As an example. Our MutableLiveData
A. mLapseTime.postValue("new String")
B. mLapseTime.setValue(1000l)
C. mLapseTime.changeValue(1000l)
Interface for a callback to be invoked when a shared preference is changed. Interface is named:
A. android.content.SyncStatusObserver
B. android.content.SharedPreferences.Editor
C. android.content.SharedPreferences.OnSharedPreferenceChangeListener
D. android.content.SharedPreferences
What statements about InputStreamReader (java.io.InputStreamReader) are correct? (Choose two.)
A. An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.
B. An InputStreamReader is a bridge from character streams to byte streams: It reads characters using a specified charset and encodes them into bytes. The charset that it uses may be specified by name or may be given explicitly, or the platform's default charset may be accepted.
C. Each invocation of one of an InputStreamReader's read() methods may cause one or more bytes to be read from the underlying byte-input stream. To enable the efficient conversion of bytes to characters, more bytes may be read ahead from the underlying stream than are necessary to satisfy the current read operation.
D. No any invocation of one of an InputStreamReader's read() methods can cause some bytes to be read from the underlying byte-input stream.
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. Activity/Fragment
B. ViewModel
C. Repository
D. Room database
As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.getTimer() method returns a LiveData
A. mTimerViewModel.getTimer().getValue().toString().observe(new Observer
callAnyChangeUIMethodHere(aLong)
}
});
B. mTimerViewModel.getTimer().observe(this, new Observer
callAnyChangeUIMethodHere(aLong)
}
});
C. mTimerViewModel.observe(new Observer
callAnyChangeUIMethodHere(aLong)
}
});