Android Architecture Components are a part of Android Jetpack.
As the Android Jetpack components are a collection of libraries that are individually adoptable and are built to work together while taking advantage of Kotlin language features that make us more productive.
These software components have been arranged in 4 categories and they are as
- Architecture Components.
- Foundation Components
- Behaviour Components
- UI Components.
Android architecture components are a collection of libraries that help us in:
- Building the robust Android application.
- Building the testable Android application.
- Building the maintainable Android Apps.
Architecture components help in managing our UI component lifecycle & handling data persistence.
All the Android Architecture Components are as follows:
- Data Binding: It helps in declaratively binding UI elements to in our layout to data sources of our app.
- Lifecycles: It manages activity and fragment lifecycles of our app, survives configuration changes, avoids memory leaks and easily loads data into our UI.
- LiveData: It notifies views of any database changes. Use LiveData to build data objects that notify views when the underlying database changes.
- Navigation: It handles everything needed for in-app navigation in Android application.
- Paging: It helps in gradually loading information on demand from our data source.
- Room: It is a SQLite object mapping library. Use it to Avoid boilerplate code and easily convert SQLite table data to Java objects. Room provides compile time checks of SQLite statements and can return RxJava, Flowable and LiveData observables.
- ViewModel: It manages UI-related data in a lifecycle-conscious way. It stores UI-related data that isn’t destroyed on app rotations.
- WorkManager: It manages every background jobs in Android with the circumstances we choose.
Now, its time to get started with the Android Architecture Components in our projects.
The best way to start with it is to try it on the Codelab directly from Google.
What you’ll learn
How to design and construct an app using the Architecture Components Room and Lifecycles Libraries.
There are a lot of steps to using the Architecture Components and implementing the recommended architecture. The most important thing is to create a mental model of what is going on and understand how the pieces fit together and they data flows together.
That’s it. Thanks for reading.