# Crash course on the Android UI layer | Part 2

DevFeed: [Crash course on the Android UI layer | Part 2](<https://devfeed.tech/articles/crash-course-on-the-android-ui-layer-part-2-22599.md>)

Original publisher: [Read original article](<https://medium.com/bumble-tech/crash-course-on-the-android-ui-layer-part-2-2335171467e0?source=rss----6353b5325b1a---4>)

Author: Manuel Vivo

Published: 2023-12-19T15:58:45Z

Content type: tutorial

Language: en

Sources: [Bumble Tech](<https://devfeed.tech/sources/bumble-tech.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>), [business logic](<https://devfeed.tech/topics/business-logic.md>), [implementation](<https://devfeed.tech/topics/implementation.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [navigation](<https://devfeed.tech/topics/navigation.md>), [data](<https://devfeed.tech/topics/data.md>), [Requirements](<https://devfeed.tech/topics/requirements.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [apis](<https://devfeed.tech/tags/apis.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [best-practices](<https://devfeed.tech/tags/best-practices.md>), [business-logic](<https://devfeed.tech/tags/business-logic.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [navigation](<https://devfeed.tech/tags/navigation.md>), [requirements](<https://devfeed.tech/tags/requirements.md>), [ui](<https://devfeed.tech/tags/ui.md>), [viewmodel](<https://devfeed.tech/tags/viewmodel.md>)

## AI overview

Part 2 of a series on the Android UI layer explains state holders, saving UI state, state hoisting, and the distinction between business logic and UI logic. It describes how these types of logic should respond to configuration changes.

## Source excerpt

Crash Course on the Android UI Layer | Part 2State Holders and Saving State This blog post series aims to summarise the Android Developer guidance on the UI layer. We'll explore all the entities involved in it, understand the role each part plays, and discuss best practices. By the end of this series, you will have a general understanding of what happens on the UI layer and how to best handle state and logic within it, the various APIs involved, and how to use them. Additionally, we'll provide decision trees to assist you when you're in doubt. In part 1, we covered the UI and the UI state. You should already know the different entities present on the UI layer, and how to think about the UI and UI state effectively. Crash course on the Android UI layer | Part 1 Now it's time for Part 2! We'll cover state holders and other UI layer-related topics such as where to hoist state and save UI state on Android. If you prefer to consume this content in video format, check out the talk I delivered at Droidcon London 2023: Peeling Back the Layers: Unmasking the UI-nknown! State holders State holders simplify the UI by handling logic and/or exposing UI state. In this section, we'll see how to implement state holders and the implementation details to consider. To determine the implementation details, we first need to identify the types of logic commonly found in an Android app. Types of logic We have already discussed that business logic involves implementing the product requirements that specify how application data is created, stored, and modified. When business logic is present in the UI layer, it's recommended to manage this logic at the screen level. We'll see more of this later. Another type of logic is the UI logic. UI logic determines how to display state changes on the screen. While business logic dictates what to do with data, UI logic determines how to visually display it. The UI logic is dependent on the UI configuration. For instance, in a typical app, displaying a d