90 Like 0 Dislike
📗 Read the blog post about MVVM on Android👇👇 https://resocoder.com/mvvm-introduction-android Start saving time now by planning weekly with Week Sweep: http://bit.ly/2Jf3QA0 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: ● http://resocoder.com Follow me on social media: ● https://www.facebook.com/resocoder ● https://twitter.com/resocoder
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 → https://goo.gl/hWAq6R * Reactive UIs with ViewModel and Data Binding * Includes basic transformations map and switchMap and MediatorLiveData LiveData is usually created in a ViewModel class → https://goo.gl/f3gTQx] The Lifecycle library includes other classes that LiveData works with, including Lifecycle, LifecycleOwner and LifecycleObservable. To learn more about the Lifecycle library, check out → https://goo.gl/pouGCk Gradle dependencies → https://goo.gl/xD4evT Also take a look: Room with a View Codelab [LiveData, ViewModel, Room and the architectural guidance] → http://bit.ly/2FS6YQD Exposing error and loading state via LiveData → https://goo.gl/fjwccG ViewModels and LiveData - Patterns and Antipatterns → https://goo.gl/1t3tmL LiveData with SnackBar, Navigation and other events (the SingleLiveEvent case) → http://bit.ly/2rsmwGl Subclassing LiveData → https://goo.gl/53Qq52 Using LifecycleObserver → https://goo.gl/e73zTc Lifecycle codelab → https://goo.gl/OBkIfC Guide to app architecture → https://goo.gl/tfae2D Data Binding docs → http://bit.ly/2IjFicG Watch more Android Jetpack videos here → https://goo.gl/kw8LPv Subscribe to the Android Developers channel here → https://goo.gl/vLYDU #AndroidJetpack #jetpack #featured
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: https://goo.gl/Gt9K97 Subscribe to the Android Developers channel at http://goo.gl/GEh1ds Music by Terra Monk: https://www.terramonk.com #androiddevsummit2015 #databinding
Thanks to DeepSpar for sponsoring this video! Check out their RapidSpar Data Recovery Tool at http://geni.us/rapidspar 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: http://geni.us/sLlhDf Buy HDDs on Newegg: http://geni.us/a196 Linus Tech Tips merchandise at http://www.designbyhumans.com/shop/Linustechtips Linus Tech Tips posters at http://crowdmade.com/linustechtips Our Test Benches on Amazon: https://www.amazon.com/shop/linustechtips Our production gear: http://geni.us/cvOS Twitter - https://twitter.com/linustech Facebook - http://www.facebook.com/LinusTech Instagram - https://www.instagram.com/linustech Twitch - https://www.twitch.tv/linustech Intro Screen Music Credit: Title: Laszlo - Supernova Video Link: https://www.youtube.com/watch?v=PKfxm... iTunes Download Link: https://itunes.apple.com/us/album/sup... Artist Link: https://soundcloud.com/laszlomusic Outro Screen Music Credit: Approaching Nirvana - Sugar High http://www.youtube.com/approachingnir... Sound effects provided by http://www.freesfx.co.uk/sfx/
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: https://wp.me/p8jOJP-9i Go to my website for more information, code examples and articles: ● http://resocoder.com Follow me on social media: ● https://www.facebook.com/resocoder ● https://twitter.com/resocoder
📗 Get the code written in this tutorial 👇👇
Start saving time now by planning weekly with Week Sweep: http://bit.ly/2Jf3QA0
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: