Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kickstart Modern Android Development with Jetpack and Kotlin

You're reading from   Kickstart Modern Android Development with Jetpack and Kotlin Enhance your applications by integrating Jetpack and applying modern app architectural concepts

Arrow left icon
Product type Paperback
Published in May 2022
Publisher Packt
ISBN-13 9781801811071
Length 472 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Catalin Ghita Catalin Ghita
Author Profile Icon Catalin Ghita
Catalin Ghita
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Part 1: Exploring the Core Jetpack Suite and Other Libraries
2. Chapter 1: Creating a Modern UI with Jetpack Compose FREE CHAPTER 3. Chapter 2: Handling UI State with Jetpack ViewModel 4. Chapter 3: Displaying Data from REST APIs with Retrofit 5. Chapter 4: Handling Async Operations with Coroutines 6. Chapter 5: Adding Navigation in Compose With Jetpack Navigation 7. Part 2: A Guide to Clean Application Architecture with Jetpack Libraries
8. Chapter 6: Adding Offline Capabilities with Jetpack Room 9. Chapter 7: Introducing Presentation Patterns in Android 10. Chapter 8: Getting Started with Clean Architecture in Android 11. Chapter 9: Implementing Dependency Injection with Jetpack Hilt 12. Chapter 10: Test Your App with UI and Unit Tests 13. Part 3: Diving into Other Jetpack Libraries
14. Chapter 11: Creating Infinite Lists with Jetpack Paging and Kotlin Flow 15. Chapter 12: Exploring the Jetpack Lifecycle Components 16. Other Books You May Enjoy

Chapter 1: Creating a Modern UI with Jetpack Compose

Jetpack libraries enable you to build and design high-quality, robust Android apps that have a reliable architecture and work consistently across different versions and devices. At the same time, the Jetpack suite allows you to eliminate boilerplate code and ultimately focus on what matters – building the necessary features.

In this chapter, we will tackle one of the most popular Jetpack libraries for building user interfaces (UIs), called Compose. Simply put, Jetpack Compose is a powerful modern toolkit that allows you to build a native UI in Android directly with Kotlin functions and APIs.

Compose accelerates and greatly simplifies UI development as it harnesses the power of declarative programming, combined with the ease of use of the Kotlin programming language. The new toolkit solely relies on Kotlin APIs when allowing you to construct UIs through declarative functions.

By the end of this chapter, you will know how building UIs on Android can be done with less code, powerful tools, intuitive APIs, and without the need for additional languages such as XML.

In the first section, Understanding the core concepts of Compose, we will explore the fundamental concepts behind Compose and understand how they are beneficial in helping us write better and cleaner UIs. We will see how UIs can be described with composable functions while also understanding how the new declarative way of building UIs on Android works. We will also explore how composition is favored over inheritance and how the data flow works in Compose. Finally, we will cover what recomposition is and see how essential it is to our declarative UI.

In the second section, Exploring the building blocks of Compose UIs, we will study the most important composable functions that Compose provides out of the box. Afterward, we will see how we can preview our Compose UI and how activities render it.

We will then put our knowledge to good use by creating our first Compose project about restaurants in the Building a Compose-based screen section. In the last section, entitled Exploring lists with Compose, we will learn how to correctly show more content in Compose with the help of lists.

To summarize, in this chapter, we're going to cover the following main topics:

  • Understanding the core concepts of Compose
  • Exploring the building blocks of Compose UIs
  • Building a Compose-based screen
  • Exploring lists with Compose

    Note

    As Compose is a dedicated native UI framework, we will only briefly cover the core concepts, common components, and usages of the toolkit without going into advanced topics.

You have been reading a chapter from
Kickstart Modern Android Development with Jetpack and Kotlin
Published in: May 2022
Publisher: Packt
ISBN-13: 9781801811071
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image