12. Dependency Injection with Dagger and Koin

Overview

This chapter covers the concept of dependency injection and the benefits it provides to an Android application. We will look at how we can perform dependency injection manually with the help of container classes. We will also cover some of the frameworks available for Android, Java, and Kotlin that can help developers when it comes to applying this concept. By the end of this chapter, you will be able to use Dagger and Koin to manage your app's dependencies, and you will know how to organize them efficiently.

Introduction

In the previous chapter, we looked at how to structure code into different components, including ViewModels, repositories, API components, and persistence components. ...

Get How to Build Android Apps with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.