
Android Application Architecture
In Android world, there is a lot of design patterns and many libraries which are used to make a great App Architecture.
In Google I/O 2017, Google introduced Android architecture components which brought a host of libraries which made handling lifecycles and reactive pattern easier to implement than ever before and also a recommended guide to app architecture.
And Kotlin which reduces our code and also brings a lot of inbuilt features on top of Java.
Then there are other libraries like Dagger2 which are crucial for any large scale app where there are lots of dependencies and it’s better to handle them and provide them from one place rather than creating instances all over the places.
I have made a demo project with simplest implementation of these libraries which may help as a starter project or boilerplate to understand how they work together in a MVVM (Model-View-ViewModel) pattern as mentioned in Guide to app architecture by Google.
Link: Mini Android Architecture
Screenshots:


Libraries implemented:
- Viewmodel — For keeping our business logic seperate from the view layer(activity, Fragments). It also survives orientation changes.
- Room — Local ORM Database
- LiveData — Observable data which respects lifecycle. i.e. Data is emitted only when view is in Active state(after OnStart and before OnPause)
- Dagger 2 — Dependency injection
- SortedList — notifying adapter about changes in list efficiently.
- Retrofit — Network API calls
- Gson — Json parsing
There are lots of resources and tutorials for each of these libraries by great people explaining them in detail and with abundant knowledge.
If you are new to android you can use this project as a template for playing and learning about MVVM pattern, also go through the documentation and tutorials to learn about them in depth.