Google Developers Certification - Associate Android Developer (Kotlin and Java Exam) - Associate-Android-Developer Exam Practice Test
As an example. In an Activity we have our TimerViewModel object (extended ViewModel), named mTimerViewModel. mTimerViewModel.timer method returns a LiveData<Long> value. What can be a correct way to set an observer to change UI in case if data was changed?
Correct Answer: C
LiveData.postValue() and LiveData.setValue() methods have some differences. So if you have a following code executed in the main thread:
liveData.postValue("a"); liveData.setValue("b");
What will be the correct statement?
liveData.postValue("a"); liveData.setValue("b");
What will be the correct statement?
Correct Answer: D
What is the incorrect statement about Data Access Object (androidx.room.Dao)?
Correct Answer: B
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 Evaluate Expression you can
Correct Answer: F
If constant LENGTH_INDEFINITE is used as a parameter for the setDuration method in Snackbar, what will happen?
Correct Answer: C
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:
Correct Answer: C