Architecture Components

Android Architecture Components

Google+ Pinterest LinkedIn Tumblr

Android Jetpack is a set of component tools and guidance provided by Google for Android developers to make create android apps in the very efficient and effective manner. We have divided Jetpack component into four major categories as Foundation, Architecture, Behaviour and UI.

In this blog, I’m going to explain android architecture components. Android architecture components collection of party libraries that help you to design and build robust, testable and maintainable apps. Most importantly, You use architecture component you will have favour amount of boilerplate code hence your code should be cleaner and readable.

Architecture Components

  1. Data Binding
  2. LifeCycle Awareness
  3. ViewModel
  4. LiveData
  5. Room
  6. Navigation
  7. Work Manager
  8. Paging Library
Data Binding

Data Binding library allows us to bind to UI component in our layout data sources using a decorative format. This allows UI values to update automatically without manual intervention, which reduces a lot of boilerplate code in your app. Read More

LifeCycle Awareness

Every activity or Fragment in an Android application has a life cycle.  Life cycle status of activity to fragment always changes. When we can create separate classes with life cycle aware component we can create separate classes to observe the changes in life cycle state and act accordingly. This helps to create better organised and lightweight code, it is easier to maintain. Read More

ViewModel

The ViewModel is the modal class for a View which keeps data for View.  if it is required you can create separate ViewModel for each Activity and Fragment in your application. this class is designed to store and manage UI related data in a life cycle constancy. the ViewModel class allows data to service configuration changes. Such as screen rotation, keyboard changes language changes and enables multi-window mode. Read More

Live Data

Live Data- is an observable data holder class.  We can user live data to get real-time update user the using interfaces. Live Data only updates app component observers data in an active life cycle state. Live data does not replace RxJava but it allows us to perform some task done by RxJava in much easier manner. Read More

Room Persistence Library

It is a database persistence library is a great alternative to SqliteOpenHelper which have been used by Android developer for many years to work with SQLite database. Room access the wrapper around SQLite Database. Room reduces boilerplate code and makes sure code base cleaner and much readable. Read More

Navigation

It Helps developers to design the interactions that allow user to move across, into and back out from different content area within the app.  This includes the navigation UI class, which contains static methods which manage navigation with AppCompact bar and Navigation Drawer and Bottom Navigation.

Work Manager

There are lots of background processing task in an android application, likes and looks, upload data and sync database with remote server. You can create a background task and hand it off to WorkManager to run immediately or at an appropriate time. WorkManager is the latest and best way to perform background task based on different factor. such as  the device API level and App state

Paging Library

Paging Library makes it easier to load data to RecyclerView, step by step in your app using live data.  It supports to bounded and unbounded list both.

Author

Write A Comment