Cleaner Architecture for Android Apps

Most Android architecture discussions center around one pain point: maintainability. After months of hard work, the team is ready to push the changes live to Google Play. Everything seems to be going well. Then business requirements change.

“Add an EditText widget to the home screen,” they say. Simple enough, you add the EditText. “Can you modify the app to use a new API endpoint?” A little more complex, but you comply. This can go on and on. When does it stop?

For most developers, unfortunately, the answer is never. Requirements are constantly changing, and developers need to react quickly and efficiently as business requirements change.

How can we create Android apps that are easy maintain? The true answer is long and complex, but can be summed up in a few words: use common design patterns and stick to an architecture like MVVM or MVP. Make use of standard libraries and frameworks like RxJava, Dagger, Android Architecture Components and Picasso.

There is there is always a cost — or tax — associated with developing and maintaining Android apps:

  1. The cost of creating
  2. The cost of maintaining
  3. The cost of deploying

If Google Play is the distribution model, number 3 is basically nothing. Number 1 is what Android Developers focus one, because the app needs to ship yesterday. But maybe developers should focus on number 2. Can you successfully add a feature to the app with little effort? can you do it 6 months from now? a year from now?

In this series, we will explore clean architecture for Android, because the goal is, and has always been, to create apps that are easy to create and maintain, so that it has a healthy lifetime.

About the author

Daniel Malone
Bringing more than a decade of software engineering experience, Daniel Malone is Editor at androidEveryday. An Austin native, Daniel is often found reading technical books, blogging and creating YouTube tutorials. When not working, he likes to listen to pop hits on Google Play Music.

findViewById() in Kotlin

  • As you may have discovered, findViewByid() is no longer needed.
  • Kotlin adds the ability to directly access Views.

1 week ago

Android Architecture Components Tutorial: ViewModel + LiveData

  • Use Kotlin to build a basic Android app using Android Architecture Components.
  • As part of Jetpack, LiveData and ViewModel support a MVVM app architecture.

3 weeks ago

Android SharedPreferences Tutorial in Kotlin

  • Use SharedPreferences to store simple data in Android Studio projects.
  • It's good for storing small amounts of data

    3 weeks ago