Since the very early releases of Android until today, the architecture of Android applications has evolved to support production-quality apps that can be developed with robust designs, testing capabilities, and maintainable code. This article explains how the architecture of an Android application can be seen in two different dimensions: the logical dimension and the modularized dimension.

The article and the explanations are given are based on MoviesPreview, which is an application that allows a user to browse the data exposed by The Movie DB API to see different information about movies, actors/actresses, and some other features. The full code of the project can be found in the following link:

The Logical Dimension

I decided to name this dimension the Logical Dimension since it explains the architecture from a logical point of view: what is the logic that each layer of the architecture is containing.

From this dimension, the application is architected in three different layers, sitting one on top of the other: the View Layer, the Domain Layer, and the Data Layer.

Image for post

Logical Dimension

  • The **View Layer **has the responsibility of rendering the view state of the application. The view state of the application is the result of the execution of the application’s use case and its adaptation to ‘UI Language’. A detailed explanation can be found in this article.
  • The Domain Layer has the responsibility of executing the logic encapsulated in the application’s use cases. Each Use Case represents a feature that the application provides to the user. More information can be found here.
  • The Data Layer takes care of abstracting the upper layers of the different data sources that can provide information to the application. This Medium article contains a detailed explanation of the repository pattern used in this layer.

#android-app-development #android #androiddev #software #architecture

Android Architecture Example: Layers and Modules
2.90 GEEK