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.
Courses : 2
Specification: Android Architecture Components – View Model
9 reviews for Android Architecture Components – View Model