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.

Daniel Malone 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.

Android RecyclerView Tutorial (Part 1)

  • Most apps contain lists of data using RecyclerView.
  • In this tutorial, use ConstraintLayout and Kotlin to display a list of data.

3 years ago

findViewById() in Kotlin

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

3 years 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 years 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 years ago

Android RecyclerView with Kotlin – Part 3

  • In part three of this series, finish creating the RecyclerView.
  • Use onBindViewHolder to display data.

3 years ago

Android RecyclerView with Kotlin – Part 2

  • Create the entire RecylerView for our UsersAdapter.
  • Continued from part 1, where we set up the Android Studio project.

3 years ago

Android and RxJava: Using a Single

  • Use RxJava's Single class when the expected type is either a success or error.
  • It's only slightly different from Observable.just(), which we discussed in the last article.

3 years ago

Android and RxJava: Getting Started

  • The powerful library RxJava can help developers build better apps.
  • See how to use Observables and Observers in this tutorial.

3 years ago

Android RecyclerView with Kotlin - Part 1

  • Oftentimes, developers need to display a list of some sort of data.
  • Whatever type of data is displayed, you should use a RecyclerView.

3 years ago

Display Sample Data when Creating a RecyclerView

  • Android Studio's default RecyclerView preview lacks sample data.
  • Adding sample data can be helpful for debugging.

3 years ago

Android Studio Tutorial with Kotlin (2018 Edition) - Part 2

  • Create a UI in Android Studio using the Design mode.
  • In this latest installment for beginners, we'll add a widget to our screen.

3 years ago