Android Developers1.31 млн
Следующее
Опубликовано 10 ноября 2017, 22:03
THIS VIDEO HAS BEEN DEPRECATED. New version here → goo.gl/WG2YaT
We've introduced Android Jetpack! View the up-to-date Architecture Components video here → goo.gl/PmGJuL
LiveData is part of the Lifecycle library which was designed to help you solve common Android Lifecycle challenges and to make your apps more maintainable and testable.
LiveData is a lifecycle-aware observable. LiveData makes it easy to keep what's showing on screen in sync with the data. Benefits include:
* Lifecycle awareness: LiveData works well with the android lifecycle by only sending updates to UI components that are on screen and automatically removing listeners when a UI component is destroyed.
* Supports proper encapsulation using a combination of LiveData and MutableLiveData
* Can be returned by Room
* Includes basic transformations map and switchMap and MediatorLiveData
LiveData is usually created in a ViewModel class:
The Lifecycle library includes other classes that LiveData works with, including Lifecycle, LifecycleOwner and LifecycleObservable. To learn more about the Lifecycle library, check out: goo.gl/pouGCk
Gradle dependencies: goo.gl/xD4evT
Also check out:
Exposing error and loading state via LiveData: goo.gl/fjwccG
ViewModels and LiveData - Patterns and Antipatterns: goo.gl/1t3tmL
Subclassing LiveData: goo.gl/53Qq52
Using LifecycleObserver: goo.gl/e73zTc
Lifecycle codelab: goo.gl/OBkIfC
Guide to app architecture: goo.gl/tfae2D
Check out the rest of the playlist here: goo.gl/WiDD2p
Subscribe to the Android Developers channel here: goo.gl/vLYDU
We've introduced Android Jetpack! View the up-to-date Architecture Components video here → goo.gl/PmGJuL
LiveData is part of the Lifecycle library which was designed to help you solve common Android Lifecycle challenges and to make your apps more maintainable and testable.
LiveData is a lifecycle-aware observable. LiveData makes it easy to keep what's showing on screen in sync with the data. Benefits include:
* Lifecycle awareness: LiveData works well with the android lifecycle by only sending updates to UI components that are on screen and automatically removing listeners when a UI component is destroyed.
* Supports proper encapsulation using a combination of LiveData and MutableLiveData
* Can be returned by Room
* Includes basic transformations map and switchMap and MediatorLiveData
LiveData is usually created in a ViewModel class:
The Lifecycle library includes other classes that LiveData works with, including Lifecycle, LifecycleOwner and LifecycleObservable. To learn more about the Lifecycle library, check out: goo.gl/pouGCk
Gradle dependencies: goo.gl/xD4evT
Also check out:
Exposing error and loading state via LiveData: goo.gl/fjwccG
ViewModels and LiveData - Patterns and Antipatterns: goo.gl/1t3tmL
Subclassing LiveData: goo.gl/53Qq52
Using LifecycleObserver: goo.gl/e73zTc
Lifecycle codelab: goo.gl/OBkIfC
Guide to app architecture: goo.gl/tfae2D
Check out the rest of the playlist here: goo.gl/WiDD2p
Subscribe to the Android Developers channel here: goo.gl/vLYDU
Случайные видео