Book Image

Expert Android Programming

Book Image

Expert Android Programming

Overview of this book

Android O brings a number of important changes for the users as well as the developers. If you want to create smart android applications which are fast, lightweight and also highly efficient then this is the book that will solve all your problems. You will create a complex enterprise grade app in this book. You will get a quick refresher of the latest android SDK and how to configure your development environment. Then you will move onto creating app layouts, component and module building, creating smart and efficient UIs. The most important part of a modern day app is how real time they are. With this book, you will create a smooth back-end for your app, ensure dynamic and real time communication between different app layers. As we move on, you will learn to leverage the different Android APIs and create an efficient SQLite data layer for your apps. You will implement effective testing techniques to make your app reliable and robust and finally you will learn to deploy it efficiently. The multiple stages of android development will also be simplified by giving you an industry standard set of best practices.
Table of Contents (17 chapters)
10
Building Restaurant finder

MVVM

MVVM stands for Model-View-View-Model. It is similar to the MVC model, the only difference being it has two-way data binding with the view and view-model. The changes in the view are being propagated via the view-model, which uses an observer pattern to communicate between the view-model and the model. The view in this case is completely isolated from the model.

The major advantage of using MVVM is it enables automatic changes in the view via the view-model:

Figure 2.2.3

MVVM has the following components:

  • Model: The model represents the objects in the application. This has the logic of where the data is to be fetched from.
  • View: The view is similar to the MVC pattern view, which renders information to users and contains a UI Component .xml file, activity, fragments, and dialog under the View Layer. It does not have any other logic implemented.
  • View-model: The view-model...