Data Binding with LiveData (Two-way & One-way) - Android Kotlin Tutorial

author Reso Coder   2 мес. назад

90 Like   0 Dislike

Introduction to MVVM on Android - Tutorial - Learn Android Architecture Patterns

📗 Read the blog post about MVVM on Android👇👇 Start saving time now by planning weekly with Week Sweep: Making an Android app in itself is not all that hard once you get the basics right. Making a maintainable app is a whole different story. You have to give your code a firm structure, prevent yourself from putting all the code inside an activity or fragment and make many smaller classes which have a single responsibility. How can you achieve all of this? Architectural patterns! MVC, MVP, MVVM,… While anything is better than the dreaded “spaghetti code”, MVVM is one of the best options for Android development. It’s even fully supported and encouraged by Google with their first-party libraries. In this tutorial you are going to learn all you need to know to have an idea about what MVVM actually is. As much as I don’t like theory, sometimes it’s important to know it before jumping into actual coding. There is nothing worse than writing code which you don’t understand (been there done that 😢). Go to my website for more information, code examples and articles: ● Follow me on social media: ● ●

Android Jetpack: LiveData

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. * Can be returned by Room, to learn more about Room → * Reactive UIs with ViewModel and Data Binding * 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 → Gradle dependencies → Also take a look: Room with a View Codelab [LiveData, ViewModel, Room and the architectural guidance] → Exposing error and loading state via LiveData → ViewModels and LiveData - Patterns and Antipatterns → LiveData with SnackBar, Navigation and other events (the SingleLiveEvent case) → Subclassing LiveData → Using LifecycleObserver → Lifecycle codelab → Guide to app architecture → Data Binding docs → Watch more Android Jetpack videos here → Subscribe to the Android Developers channel here → #AndroidJetpack #jetpack #featured

Data Binding -- Write Apps Faster (Android Dev Summit 2015)

Android Data Binding, introduced at Google I/O as a preview, allows developers to write applications faster, easier, with fewer bugs, and with no performance impact. By adding a binding expression to your layout XML, you can tie the data model back end to your UI. George Mount & Yigit Boyar discuss how this is done and some of the magic that is happening behind the scenes to make this possible. Watch more talks from Android Dev Summit 2015 here: Subscribe to the Android Developers channel at Music by Terra Monk: #androiddevsummit2015 #databinding

Don't Waste $1000 on Data Recovery

Thanks to DeepSpar for sponsoring this video! Check out their RapidSpar Data Recovery Tool at RapidSpar is the first cloud-driven device built to help IT generalists and other non-specialized users recover client data from damaged or failing HDDs/SSDs Buy HDDs on Amazon: Buy HDDs on Newegg: Linus Tech Tips merchandise at Linus Tech Tips posters at Our Test Benches on Amazon: Our production gear: Twitter - Facebook - Instagram - Twitch - Intro Screen Music Credit: Title: Laszlo - Supernova Video Link: iTunes Download Link: Artist Link: Outro Screen Music Credit: Approaching Nirvana - Sugar High Sound effects provided by

Kotlin - Apply, Let, Run, With, Also - Higher Order Standard Functions

Kotlin is all about simplifying the development. Kotlin's standard library is full of useful classes and functions which aim to fulfill this promise even where the built-in language features don't exist. One of such groups of functions in standard library are Kotlin's higher order functions apply, let, run, with and also. These functions allow you to write more concise, simpler code by removing code duplication. Warning! Once you start using them, you won't be able to imagine coding without them! Get the code from this tutorial: Go to my website for more information, code examples and articles: ● Follow me on social media: ● ●

📗 Get the code written in this tutorial 👇👇

Start saving time now by planning weekly with Week Sweep:

Managing the layout programmatically can be quite time consuming and verbose on Android. Even though Kotlin spares you of calling findViewById, accessing views in the activity code can still get ugly. When you use data binding, you can do most of the UI related stuff right in the XML layouts.

With LiveData, data binding becomes even more powerful and simple to use. While you could create observable fields even in the past when LiveData didn't exist, this new life-cycle aware observable makes data binding even better and simpler.

In this tutorial you are going to learn how to use one-way and two-way data binding with LiveData and MVVM architecture.

Go to my website for more information, code examples and articles:

Follow me on social media:

Comments for video: