Vind een opleiding

Android Architecture Components - View Model - Udemy

Doelgroep: Alle niveaus
Duur: 32 colleges - 1 uur
Richtprijs: € 19,99
Taal: Engels
Aanbieder: Udemy

>> proefles

Hello everyone, thanks for stopping by!

Android development has many things going for it; it's easy to get started, low cost, great tools, and you can build something that can run on billions of devices. 

One of the big complaints from developers has been handling the Android component lifecycle. Activities and Fragments can be destroyed at any time and recreated. This means that you will lose any information that you don't explicitly save in the Bundle provided to onSaveInstanceState. However, even then, saving everything into the Bundle not only adds a lot of boilerplate, but you have to deal with a very low size limit of what you can put into the Bundle. This leads to juggling a database, or some other persistent storage, just so you can retain data across configuration changes. Or, you could use singletons which introduces another type of complexity.

There are ways to handle this that require a relatively steep learning curve (for example, using Dagger 2 with scopes). Google thought that there should be something with a lower barrier to entry for developers to use.

Google recently released Architecture Components for Android. These are a collection of libraries that, among other things, help developers manage data without having to worry so much about Activity or Fragment lifecycles.

This course is focused on the ViewModel from Architecture Components. You're going to learn how to use the ViewModel to encapsulate long-running operations (network calls using Retrofit), retain data across configuration changes, and pass data between screens. You'll also see how you can use Dagger 2 to make the ViewModel injectable. 

With that said, I hope you're excited to get started. See you in class!


>> Meer info