
Android UI Development with Jetpack Compose
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
- Explore the Compose app structure, UI elements, and core concepts like state and composition over inheritance
- Enhance apps with animations, transitions and build for smartphones, tablets, and foldable devices
- Purchase of the print or Kindle book includes a free PDF eBook
Book DescriptionCompose has caused a paradigm shift in Android development, introducing a variety of new concepts that are essential to an Android developer's learning journey. It solves a lot of pain points associated with Android development and is touted to become the default way to building Android apps over the next few years. This second edition has been thoroughly updated to reflect all changes and additions that were made by Google since the initial stable release, and all examples are based on Material 3 (also called Material You). This book uses practical examples to help you understand the fundamental concepts of Jetpack Compose and how to use them when you are building your own Android applications. You'll begin by getting an in-depth explanation of the declarative approach, along with its differences from and advantages over traditional user interface (UI) frameworks. Having laid this foundation, the next set of chapters take a practical approach to show you how to write your first composable function. The chapters will also help you master layouts, an important core component of every UI framework, and then move to more advanced topics such as animation, testing, and architectural best practices. By the end of this book, you'll be able to write your own Android apps using Jetpack Compose and Material Design.What you will learn - Recognize the motivation behind Jetpack Compose
- Gain an understanding of the core concepts of Jetpack Compose
- Build a complete app using Jetpack Compose
- Utilize Jetpack Compose inside existing Android applications
- Test and debug apps that use Jetpack Compose
- Understand Material Design and how it is implemented using Jetpack Compose
- Write apps for different form factors
- Bring your Compose UI to other platforms
Who this book is forIf you're an Android developer with existing knowledge of the Kotlin programming language looking to learn how to build modern Android user interfaces using Jetpack Compose, then this book is for you. This book is not an introduction to Android development. You must have a basic understanding of how Android apps are developed using Android Studio.
All prices
More details
Other editions
Additional editions

Previous edition

Content
- Cover
- Title Page
- Copyright and Credits
- Dedications
- Contributors
- Table of Contents
- Part 1: Fundamentals 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
- Questions
- 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
- Exercise
- 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
- Questions
- Part 2: Building User Interfaces
- Chapter 4: Laying Out UI Elements in Compose
- 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
- Questions
- Chapter 5: Managing 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
- Questions
- Chapter 6: Building a Real-World App
- 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
- Questions
- Chapter 7: Exploring App Architecture
- 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
- Questions
- Exercise
- Part 3: Advanced 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
- Exercise
- 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
- Questions
- 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
- Questions
- Chapter 11: Developing for Different Form Factors
- Technical requirements
- Understanding different form factors
- Preparing for adaptive layouts
- Enhancing the UI
- Introducing Window Size Classes
- Using Jetpack WindowManager
- Reading hinge and fold features
- Organizing the screen content
- Summary
- Exercise
- Chapter 12: Bringing Your Compose UI to Different Platforms
- Technical requirements
- Introducing Compose Multiplatform
- Setting up a Compose Multiplatform project
- Running the sample app
- Building a cross-platform app
- Accessing composables from platform-specific code
- Developing across platforms
- Using Mobile Kotlin resources
- Summary
- Exercise
- Index
- Other Books You May Enjoy
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.
File format: ePUB
Copy protection: without DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Use a reader that can handle the file format ePUB, such as Adobe Digital Editions or FBReader – both free (see eBook Help).
- Tablet/Smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePUB works well for novels and non-fiction books – i.e., 'flowing' text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook does not use copy protection or Digital Rights Management
For more information, see our eBook Help page.