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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.