Journey of Android Architecture Pattern and which pattern should developer prefer to use in android app developement

Sharing is caring!

As we all know that Android has started the beginning with Java as a primary language and that that time Java became a very popular language for web development because of its great feature like object-oriented robustness, platform independent and major is security compliance, etc.

Many of the developer working on the server side and consuming the Java API. And those developers who are knowing the good concept of java and working on server side writing imperative code, they moved to Android application development. We all started writing the imperative code in android development too. It may be causing the android app performance issue, a lot of memory leaks because of unaware of life cycle behaviors of Android. But the thing is that Android actually work on a different pattern.

Google has realized that old pattern like MVC framework will not going to work to solve this issue because of in one file we have written a lot of imperative code which is very difficult to understand and modify a simple function it may impact many more places. It created the performance issue of application. It is not about an android application causing this issue it may impact your business.

When we go back and check the evolution of android architecture pattern then we realize that it has been the massive change into the Android development. I remembered that I started the android application development in MVC pattern and it is very worst architecture for android. Now the community has moved to MVC to MVP or MVI pattern. I can say the MVP pattern is more comfortable to write code in android. It provides the Presenter for writing the all business logic will be in a separate file which is easy to solve any issue comes.

But again the MVP design pattern is not aware of life cycle change. You need to take care of the life cycle change and unsubscribe the channel if you looking for any update the view. For example for any network call in background and awaiting the response in main-thread to update the view but the current view is not available to take an update then it might be caused the leaks.

Now the evolution of architecture moved to MVVM design pattern for android application development. This design pattern is almost similar to the MVP design pattern the only difference is that in place of a presenter is ViewModel. View Model is life cycle aware of the change. You do not worry about life change issue. ViewModelProvider has stored the information for you which is required to update for any life cycle change happened.

Now the Google has mixed the best part of all those and make a new design pattern is called the JetPack. Jetpack is a combination of all like architecture design patterns MVVM and background thread like Coroutine and many more. We will talk about everything in detail of JetPack architecture change in our upcoming articles.

According to the official document of Android

Jetpack is a suite of libraries, tools, and guidance to help developers write high-quality apps easier. These components help you follow best practices, free you from writing boilerplate code, and simplify complex tasks, so you can focus on the code you care about.

Jetpack comprises the androidx.* package libraries, unbundled from the platform APIs. This means that it offers backward compatibility and is updated more frequently than the Android platform, making sure you always have access to the latest and greatest versions of the Jetpack components.

The question is why does android make the big change every time? It may impact to every developer to struggle to learn a new concept to build an android application. So my answer is that it is required to make an awesome application which can make more quality code for a quality business. Generally, the android faces many issues of android framework life cycle change, reading and writing code, the testing code in a proper manner and learning curve for each and every developer.

Android Jetpack Components

Android Jetpack components are a collection of libraries that are individually adaptable and 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 which are as follows:

  • Foundation Components
  • Architecture Components
  • Behavior Components
  • UI Components

In the Foundation components come the change of backward compatibility and android ktx and many more etc. The architecture components help us in building the testable and maintainable apps. This component having the change of DataBindig, LifeCycle, Navigation, Paging, ViewModel, Room, and WorkManager, etc.

The behavior components help in the integration with standard Android services like Notification, Permission, etc. The UI components provide widgets and helpers to make your app not only easy but delightful to use. In this component having a change in Fragment, Layout, and Animation and transition.

We will go through all changes of JetPack in our upcoming tutorial with the example to understand that how the component will help us to make an awesome Android application in term of aware of life cycle change, easy to read and write the code and easy to write test code to the application.

Wrapping 

Now we have a good understanding of the evolution of the Android architecture pattern and what developer should prefer to use in the android application development to make and awesome application.  So my next tutorial, we will learn all the jetpack Components in detail which are required to learn and adapt to every developer to write the quality code, ok till then enjoy your healthy day.

If you are wondering to learn Android then Please learn from Android category and wondering to learn Kotlin then Kotlin Category will help you. If you want to learn all the python article, then learn from the python category.

0 0 votes
Article Rating
Journey of Android Architecture Pattern and which pattern should developer prefer to use in android app developement
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
Scroll to top
0
Would love your thoughts, please comment.x
()
x