𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Android UI Development with Jetpack Compose

✍ Scribed by Thomas Künneth


Publisher
Packt Publishing
Year
2022
Tongue
English
Leaves
248
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Get started with creating intuitive native user interfaces on Android platforms

Key Features

  • Understand the difference between the imperative (Android View) and declarative (Jetpack Compose) approach
  • Learn about the structure of a Compose app, built-in Compose UI elements, and core concepts such as state hoisting and composition over inheritance
  • Write, test, and debug composable functions

Book Description

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 tutorials and projects, 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.

What you will learn

  • Gain a solid understanding of the core concepts of Jetpack Compose
  • Develop beautiful, neat, and immersive UI elements that are user friendly, reliable, and performant
  • Build a complete app using Jetpack Compose
  • Add Jetpack Compose to your existing Android applications
  • Test and debug apps that use Jetpack Compose
  • Find out how Jetpack Compose can be used on other platforms

Who this book is for

This book is for any mobile app developer looking to understand the fundamentals of the new Jetpack Compose framework and the benefits of native development. A solid understanding of Android app development, along with some knowledge of the Kotlin programming language, will be beneficial. Basic programming knowledge is necessary to grasp the concepts covered in this book effectively.

Table of Contents

  1. Building Your First Compose App
  2. Understanding the Declarative Paradigm
  3. Exploring the Key Principles of Compose
  4. Laying Out UI Elements
  5. Managing the State of Your Composable Functions
  6. Putting Pieces Together
  7. Tips, Tricks, and Best Practices
  8. Working with Animations
  9. Exploring Interoperability APIs
  10. Testing and Debugging Compose Apps
  11. Conclusion and Next Steps

✦ Table of Contents


Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1Fundamentals of Jetpack Compose
Chapter 1: Building Your First Compose App
Technical requirements
Saying hello to composable functions
Showing a welcome text
Using rows, text fields, and buttons
Showing a greeting message
Using the preview
Preview parameters
Configuring previews
Grouping previews
Running a Compose app
Deploying a composable function
Using composable functions in activities
Looking under the hood
Pressing the play button
Summary
Further reading
Chapter 2: Understanding the Declarative Paradigm
Technical requirements
Looking at the Android view system
Inflating layout files
Modifying the UI
Moving from components to composable functions
Component hierarchies
Limitations of component hierarchies
Composing UIs with functions
Examining architectural aspects
Reacting to clicks
Sizing and positioning UI elements
Summary
Chapter 3: Exploring the Key Principles of Compose
Technical requirements
Looking closer at composable functions
Building blocks of composable functions
Emitting UI elements
Returning values
Composing and recomposing the UI
Sharing state among composable functions
Controlling size
Displaying a composable hierarchy inside an Activity
Modifying the behavior of composable functions
Understanding how modifiers work
Implementing custom modifiers
Summary
Part 2Building User Interfaces
Chapter 4: Laying Out UI Elements
Technical requirements
Using predefined layouts
Combining basic building blocks
Creating layouts based on constraints
Understanding the single measure pass
Defining measure policies
Creating custom layouts
Implementing a custom measure policy
Summary
Chapter 5: Managing the State of Your Composable Functions
Technical requirements
Understanding stateful and stateless composable functions
Using state in a composable function
Writing stateless composable functions
Hoisting state and passing events
Creating radio button groups
Surviving configuration changes
Using ViewModel
Summary
Chapter 6: Putting the Pieces Together
Technical requirements
Styling a Compose app
Defining colors, shapes, and text styles
Using resource-based themes
Integrating toolbars and menus
Using Scaffold() to structure your screen
Creating a top app bar
Adding navigation
Defining screens
Using NavHostController and NavHost()
Summary
Chapter 7: Tips, Tricks, and Best Practices
Technical requirements
Persisting and retrieving state
Injecting objects into a ViewModel
Using the factory
Keeping your composables responsive
Communicating with ViewModel instances
Handling long-running tasks
Understanding side effects
Invoking suspending functions
Cleaning up with DisposableEffect()
Summary
Part 3Advanced Topics
Chapter 8: Working with Animations
Technical requirements
Using animation to visualize state changes
Animating single value changes
Animating multiple value changes
Showing and hiding UI elements with animations
Understanding AnimatedVisibility()
Animating size changes
Spicing up transitions through visual effects
Crossfading composable functions
Understanding animation specifications
Summary
Chapter 9: Exploring Interoperability APIs
Technical requirements
Showing Views in a Compose app
Adding custom components to a Compose app
Inflating View hierarchies with AndroidViewBinding()
Sharing data between Views and composable functions
Revisiting ViewModels
Combining View Binding and ViewModels
Embedding composables in View hierarchies
Summary
Chapter 10: Testing and Debugging Compose Apps
Technical requirements
Setting up and writing tests
Implementing unit tests
Testing composable functions
Understanding semantics
Working with semantics nodes
Adding custom semantics properties
Debugging Compose apps
Using custom modifiers for logging and debugging
Summary
Further reading
Chapter 11: Conclusion and Next Steps
Technical requirements
Exploring the future
Showing exposed drop-down menus
Using NavigationRail()
Migrating to Material You
Looking at some differences between Material 2 and Material 3 for Compose
Moving beyond Android
Setting up a sample project
Summary
Index
About PACKT
Other Books You May Enjoy


πŸ“œ SIMILAR VOLUMES


Android UI Development with Jetpack Comp
✍ Thomas KΓΌnneth πŸ“‚ Library πŸ“… 2022 πŸ› Packt Publishing 🌐 English

<p><span>Get started with creating intuitive native user interfaces on Android platforms</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Understand the difference between the imperative (Android View) and declarative (Jetpack Compose) approach</span></span></li><li><span><span>Learn

Android UI Development with Jetpack Comp
✍ Thomas KΓΌnneth πŸ“‚ Library πŸ“… 2023 πŸ› Packt Publishing 🌐 English

<p><span>Get started with creating intuitive native user interfaces on Android platforms using Kotlin and Jetpack Compose with the help of this illustrated guide</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Distinguish between the imperative (Android View) and declarative (Jetpack

Jetpack Compose 1.4 Essentials: Developi
✍ Neil Smyth πŸ“‚ Library πŸ“… 2023 πŸ› Payload Media 🌐 English

This book teaches you how to build Android applications using Jetpack Compose 1.4, Android Studio Giraffe (2023.2.1), Material Design 3, and the Kotlin programming language. The book begins with the basics by explaining how to set up an Android Studio development environment. The book also inc

Jetpack Compose 1.3 Essentials: Developi
✍ Neil Smyth πŸ“‚ Library πŸ“… 2023 πŸ› eBookFrenzy 🌐 English

This book aims to teach you how to build Android applications using Jetpack Compose 1.3, Android Studio Flamingo (2022.2.1), Material Design 3, and the Kotlin programming language. The book begins with the basics by explaining how to set up an Android Studio development environment. The book also in

Jetpack Compose 1.3 Essentials: Developi
✍ Neil Smyth πŸ“‚ Library πŸ“… 2023 πŸ› eBookFrenzy 🌐 English

This book aims to teach you how to build Android applications using Jetpack Compose 1.3, Android Studio Flamingo (2022.2.1), Material Design 3, and the Kotlin programming language. The book begins with the basics by explaining how to set up an Android Studio development environment. The book also in

Jetpack Compose by Tutorials (Second Edi
✍ Kodeco Team, Denis Buketa, Prateek Prasad πŸ“‚ Library πŸ“… 2023 πŸ› Kodeco Inc. 🌐 English

<span>Build Beautiful Apps With Jetpack Compose</span><p><span>Jetpack Compose is hyping up everyone in the Android UI toolkit world. This completely new and modern solution to building </span><span>declarative</span><span> user interfaces provides more opportunity than ever to create beautiful, rea