Google Associate Android Developer
Q: 1
In a class extended PreferenceFragmentCompat. What method is used to inflate the given XML
resource and add the preference hierarchy to the current preference hierarchy?
Options
Q: 2
Filter logcat messages. If in the filter menu, a filter option “Edit Filter Configuration”? means:
Options
Q: 3
In application theme style, flag windowActionBar () indicates:
Options
Q: 4
An example. In our ViewModelFactory (that implements ViewModelProvider.Factory) we have an
instance of our Repository, named mRepository. Our ViewModel has such constructor:
class MyViewModel(private val mRepository: MyRepository) : ViewModel() ...
Next, in our ViewModelFactory create ViewModel method (overriden) looks like this:
override fun create(modelClass: Class): T {
return try {
//MISSED RETURN VALUE HERE”
} catch (e: InstantiationException) {
throw RuntimeException("Cannot create an instance of $modelClass", e)
} catch (e: IllegalAccessException) {
throw RuntimeException("Cannot create an instance of $modelClass", e)
} catch (e: NoSuchMethodException) {
throw RuntimeException("Cannot create an instance of $modelClass", e)
} catch (e: InvocationTargetException) {
throw RuntimeException("Cannot create an instance of $modelClass", e)
}
}
What should we write instead of “//MISSED RETURN VALUE HERE”?
Options
Q: 5
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 do this:
Options
Q: 6
What do you want from Room when you create a DAO method and annotate it with @Update?
Example:
@Dao
interface MyDao {
@Update
fun updateUsers(vararg users: User)
}
Options
Q: 7
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.)
Options
Q: 8
What is the incorrect statement about Data Access Object (androidx.room.Dao)?
Options
Q: 9
Select four different types of app components. (Choose four.)
Options
Q: 10
For example, we have a file in our raw folder app/src/main/res/raw/sample_teas.json. To get an
InputStream for reading it, from out Context context, we can do this:
Options
Question 1 of 10