EXAM Flashcards
What permission is needed to perform network operations?
android.permission.INTERNET
What are the 2 main advantages of the ViewModel class?
- Persist UI state
- Place for business logic
The lifecycle of a ViewModel is directly tied to its _______.
Scope
What method does the ViewModel call when it is destroyed?
onCleared()
LiveData is an _______ data holder class.
observable
LiveData is _______-aware, meaning it respects the ______ of things like activities, fragments, etc.
lifecycle
What is the data type we use for LiveData?
MutableLiveData< Data Type >
Which lifecycle method is the best place to begin observing LiveData?
onCreate()
How do you create an observer?
val observer= Observer< Data Type > { new -> view = new }
viewModel.current.observe(this, observer)
What permissions are needed for MyLocation functionality?
- ACCESS_COARSE_LOCATION
- ACCESS_FINE_LOCATION`