<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 Compose: Bring declarative and native UI to life quickly and easily on Android using Jetpack Compose and Kotlin
β Scribed by Thomas KΓΌnneth
- Publisher
- Packt Publishing
- Year
- 2023
- Tongue
- English
- Leaves
- 278
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Get started with creating intuitive native user interfaces on Android platforms using Kotlin and Jetpack Compose with the help of this illustrated guide
Key Features
- Distinguish between the imperative (Android View) and declarative (Jetpack Compose) approach
- 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 Description
Compose 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 for
If 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.
Table of Contents
- Building Your First Compose App
- Understanding the Declarative Paradigm
- Exploring the Key Principles of Compose
- Laying Out UI Elements in Compose
- Managing State of Your Composable Functions
- Building a Real-World App
- Exploring App Architecture
- Working with Animations
- Exploring Interoperability APIs
- Testing and Debugging Compose Apps
- Developing for Different Form Factors
- Bringing Your Compose UI to Different Platforms
β¦ Table of Contents
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
π SIMILAR VOLUMES
<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
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
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
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
Accelerate your Android development journey by mastering the latest Kotlin techniques and libraries to build robust apps Key Features Apply best practices and industry-essential skills used by Google Developer Experts Find out how to publish, monitor, and improve your app metrics on the Google