From Concept to Code: Crafting an Android Audio Book App with Jetpack Compose and MVI

Waseem Abbas
3 min readJan 3, 2024

Part 1: Introduction and Project Setup

🌟 Welcome to the comprehensive guide on building an Android audio book reading and listening app using modern development frameworks such as Jetpack Compose, Kotlin, Kotlin Coroutines, Lifecycle, KTOR, Firebase, and more. This series aims to provide a step-by-step walkthrough of developing a feature-rich app, demonstrating the implementation of Clean Architecture and MVI design patterns in today’s Android development landscape.

Project Overview

By the culmination of this series, we aim to develop a sophisticated audiobook Android application featuring a comprehensive set of functionalities. The key features of the app include:

  1. Onboarding Screen: Introduces users to the app and provides a smooth initiation process.
  2. Login Screen: Facilitates secure user authentication, ensuring a personalized experience.
  3. Home Screen: Display a list of popular and recommended books. Allow users to resume reading from where they left off.
  4. Search Screen: Enables users to explore books by searching for authors and categories.
  5. Favorites Screen: Allows users to curate a personalized collection of favorite books.
  6. Book Summary: Offers detailed information about each book, assisting users in making informed choices.
  7. Book Reader: Empowers users to seamlessly switch between reading and listening modes for any selected book.
  8. Profile Screen: Displays user-specific details, providing a personalized touch and an option for logging out.

Tech Stack

Jetpack Compose

Kotlin, Kotlin Coroutines and Flow

KTOR Client for handling REST APIs

Firebase Authentication to authenticate users

Data Store & Room

ViewModel

Hilt

Project Setup

For those who have embarked on the development journey, I’d like to share that certain features of the audiobook Android app are already in place and readily available on GitHub.

If you prefer a hands-on approach, you can initiate a new Android Studio project and follow along with the coding process. Alternatively, for those seeking a quicker start, you have the convenience of cloning the existing project from the designated GitHub repository.

git clone https://github.com/waseemabbas8/libroom-android.git

Folder Structure

Clean Architecture — Folder Hierarchy

The folder hierarchy in the above image is based on the Clean Architecture pattern, which is a popular approach to structuring Android apps. The Clean Architecture pattern separates the app into layers based on their level of abstraction, so that the inner layers are independent of the outer layers. This makes the app more maintainable and testable.

1. Root folder — the package name folder

This folder contains the main application class (LIBroomApplication) and the MainActivity and MainViewModel. Other than this it contains core, feature, and navigation folders.

The LIBroomApplication is responsible for initializing the app and setting up the dependency injection with the Hilt. The MainActivity is the entry point for the app.

2. Feature folder

This folder contains subfolders for each feature of the app. In this example, there are features for authentication, authors, books, categories, favorites, home, onboarding, profile, reader, and search.Each feature folder contains subfolders for the data, domain, and presentation layers. Also, note I have managed a separate Hilt DI module for each feature.

3. Core folder

This is the beating heart of the app. All application-level classes that can be consumed in different modules of the app are placed under this directory. For example, it contains, networking classes (KTOR Client or Firebase, etc.), composeables that are shared between multiple features, base classes, and theming of the app.

Conclusion

I am pleased to inform you that advancements in the development of the audiobook Android app are well underway. The next segments of the article, detailing subsequent stages of the project, are currently in progress and will soon be made available for your perusal.

Dear you, thanks for reading this article. I would love to hear your opinion in the comment section. I would like to extend special thanks to Ryan Simon for guiding me in learning MVI and empowering my architectural skills.

Feel free to hit me up on Instagram or Facebook.

Know more about me on waseemabbs.com, GitHub, and Linkedin

--

--

Waseem Abbas

Mobile Software Engineer | Android | Flutter | Clean Architecture