Chapter 2: Understanding the Declarative Paradigm
Jetpack Compose marks a fundamental shift in Android UI development. While the traditional view-based approach is centered around components and classes, the new framework follows a declarative approach.
In Chapter 1, Building Your First Compose App, I introduced you to composable functions, the basic building blocks of a Compose-based UI. In this chapter, we will briefly review how Android UIs are implemented with traditional classes and techniques. You will learn about some issues of this approach, and how a declarative framework helps overcome them.
The main sections of this chapter are as follows:
- Looking at the Android view system
- Moving from components to composable functions
- Examining architectural concepts
We'll start by looking at my second sample app, Hello View. It is a re-implementation of the Hello app from Chapter 1, Building Your First Compose App. Hello View uses views, an XML layout...