Book Image

Android UI Development with Jetpack Compose

By : Thomas Künneth
Book Image

Android UI Development with Jetpack Compose

By: Thomas Künneth

Overview of this book

Jetpack Compose is Android’s new framework for building fast, beautiful, and reliable native user interfaces. It simplifies and significantly accelerates UI development on Android using the declarative approach. This book will help developers to get hands-on with Jetpack Compose and adopt a modern way of building Android applications. The book is not an introduction to Android development, but it will build on your knowledge of how Android apps are developed. Complete with hands-on examples, this easy-to-follow guide will get you up to speed with the fundamentals of Jetpack Compose such as state hoisting, unidirectional data flow, and composition over inheritance and help you build your own Android apps using Compose. You'll also cover concepts such as testing, animation, and interoperability with the existing Android UI toolkit. By the end of the book, you'll be able to write your own Android apps using Jetpack Compose.
Table of Contents (16 chapters)
1
Part 1:Fundamentals of Jetpack Compose
5
Part 2:Building User Interfaces
10
Part 3:Advanced Topics

What this book covers

Chapter 1, Building Your First Compose App, shows you how to build your first Compose app. Also, important key ideas such as composable functions and using previews are introduced. It is important to whet the appetite with early success, so we'll build, preview, and run composable functions before digging too deep into details.

Chapter 2, Understanding the Declarative Paradigm, explains how this was done before, and what the issues with the old approach are. Also, you'll an idea how composables are different to Views, and why this is both important and beneficial.

Chapter 3, Exploring the Key Principles of Compose, introduces the key principles that Jetpack Compose relies on. This knowledge is essential for writing well-behaved Compose apps.

Chapter 4, Laying Out UI Elements, introduces you to some of the existing layouts. It also shows you how to implement custom layouts. These are needed if the built-in layouts cannot provide the required distribution of UI elements onscreen.

Chapter 5, Managing the State of Your Composable Functions, takes a look at how Jetpack Compose uses state. State is app data that may change over time. Composable functions display and modify state. Jetpack Compose is based upon a small set of principles regarding how to use state. This chapter acquaints you with these principles.

Chapter 6, Putting Pieces Together, catches up on previously learned concepts and brings them together in one app. Seeing concepts in real code helps understand them and makes it easier to reuse them in your own programs.

Chapter 7, Tips, Tricks, and Best Practices, provides best practices when using Compose. These will include topics such as persisting and retrieving state and using so-called side effects. The chapter also shows things to avoid, such as having heavy computations inside a composable function.

Chapter 8, Working with Animations, introduces all relevant APIs. Animations and transitions make apps really shine. Jetpack Compose simplifies the process of adding animation effects greatly over the old View-based approach.

Chapter 9, Exploring Interoperability APIs, discusses strategies to combine declarative and imperative approaches in one app and offers a migration strategy to painlessly update existing UIs to Jetpack Compose.

Chapter 10, Testing and Debugging Compose Apps, introduces basic testing scenarios for Compose apps. Testing the user interface of a Compose app works differently than testing a view-based UI. Compose uses a more declarative approach to testing.

Chapter 11, Conclusion and Next Steps, wraps up the book in directing you to things you can try next. Also, the chapter attempts to guess what the future will hold for Jetpack Compose and looks into neighboring platforms and how you can benefit from your knowledge on them.