Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
How to Build Android Applications with Kotlin

You're reading from   How to Build Android Applications with Kotlin A hands-on guide to developing, testing, and publishing production-grade Android 16 apps

Arrow left icon
Product type Paperback
Published in Sep 2025
Publisher Packt
ISBN-13 9781835882764
Length 654 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Alex Forrester Alex Forrester
Author Profile Icon Alex Forrester
Alex Forrester
Eran Boudjnah Eran Boudjnah
Author Profile Icon Eran Boudjnah
Eran Boudjnah
Alexandru Dumbravan Alexandru Dumbravan
Author Profile Icon Alexandru Dumbravan
Alexandru Dumbravan
Jomar Tigcal Jomar Tigcal
Author Profile Icon Jomar Tigcal
Jomar Tigcal
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Android Foundation
2. Creating Your First App FREE CHAPTER 3. Building User Screen Flows 4. Developing the UI with Jetpack Compose 5. Building App Navigation 6. App Components
7. Essential Libraries – Ktor, Kotlin Serialization, and Coil 8. Building Lists with Jetpack Compose 9. Android Permissions and Google Maps 10. Services, WorkManager, and Notifications 11. Code Structure
12. Testing with JUnit, Mockito, MockK, and Compose 13. Coroutines and Flow 14. Android Architecture Components 15. Persisting Data 16. Dependency Injection with Dagger, Hilt, and Koin 17. Polishing and Publishing an App
18. Architecture Patterns 19. Advanced Jetpack Compose 20. Launching Your App on Google Play 21. Unlock Your Book’s Exclusive Benefits 22. Other Books You May Enjoy 23. Index

Building a navigation graph

In Jetpack Compose, navigation is created using a NavHost composable. This hosts NavGraph, which defines your composable destinations; these are defined by routes. Navigating to and from these routes is done using NavHostController, which is passed into NavHost as its parameter name, navController. The builder parameter of NavHost (builder: NavGraphBuilder.() -> Unit) creates NavGraph. Look at the following example:

@Serializable
data object Home
@Serializable
data object Detail
@Composable
fun NavigationApp() {
    val navController = rememberNavController()
    NavHost(
        navController = navController,
        startDestination = Home,
        builder = (
                {
     ...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
How to Build Android Applications with Kotlin
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
Modal Close icon
Modal Close icon