Ovidiu Muntean’s Post

View profile for Ovidiu Muntean, graphic

Senior Android Software Engineer | Crafting the apps that live in your pocket

📣 I frequently used MVVM and LiveData in my Android projects, they are powerful tools. ❗️The problem with Android UI is that Activities are destroyed and recreated each time a configuration change occurs and so on. This is the reason that we need to implement a View-Model that must delegate his behavior to ViewModel abstract class implemented by Google which handles the preservation of the view-model for the entire life cycle of the application, keeping it alive even if the activity is destroyed and then recreated. 🎯 LiveData makes data accessible and most important observable, so whenever a dataset is changed, the code in the Observer's lambda is automatically triggered. 📲 Lambda's for Kotlin are the same thing as Closures for Swift, so in the Observer we actually have a trailing closure (for an iOS analogy). 🎲 Do you use LiveData and MVVM in your Android projects? #mvvm #android #livedata #software #architecture #pattern

To view or add a comment, sign in

Explore topics