Book Image

Kickstart Modern Android Development with Jetpack and Kotlin

By : Catalin Ghita
5 (1)
Book Image

Kickstart Modern Android Development with Jetpack and Kotlin

5 (1)
By: Catalin Ghita

Overview of this book

With Jetpack libraries, you can build and design high-quality, robust Android apps that have an improved architecture and work consistently across different versions and devices. This book will help you understand how Jetpack allows developers to follow best practices and architectural patterns when building Android apps while also eliminating boilerplate code. Developers working with Android and Kotlin will be able to put their knowledge to work with this condensed practical guide to building apps with the most popular Jetpack libraries, including Jetpack Compose, ViewModel, Hilt, Room, Paging, Lifecycle, and Navigation. You'll get to grips with relevant libraries and architectural patterns, including popular libraries in the Android ecosystem such as Retrofit, Coroutines, and Flow while building modern applications with real-world data. By the end of this Android app development book, you'll have learned how to leverage Jetpack libraries and your knowledge of architectural concepts for building, designing, and testing robust Android applications for various use cases.
Table of Contents (17 chapters)
1
Part 1: Exploring the Core Jetpack Suite and Other Libraries
7
Part 2: A Guide to Clean Application Architecture with Jetpack Libraries
13
Part 3: Diving into Other Jetpack Libraries

Creating a new Compose-based screen

Real-world applications are required to display a lot of content, so one screen probably won't suffice. So far, our Restaurants application features a simple screen where all the restaurants that we receive from our remote database are displayed.

Let's practice all the skills we've learned so far by creating a new screen that will display the details of a particular restaurant. The plan is that when users press on a particular restaurant from the list inside our RestaurantsScreen() composable screen, we should take them to a new details screen for that particular restaurant.

Yet to perform navigation between two screens, we need first to build the second screen. Unlike with the first composable screen, it's time to change our tactic and build it from top to bottom. Let's build this second feature first by defining the network request, then executing it inside its own ViewModel, and finally creating the composable UI...