
Learn the basics of dependency and dependency management, illustrated by a graph of main activity, menu model, repository, database, and network service dependencies.
Continue building a Dagger stage 1 project by creating data, user interface, network, and database packages and implementing a network service and repository scaffold for dependency injection.
Build a repository and view model with dagger stage one part two, wiring database service and network service using context to manage dependencies.
Analyze the completed project's dependencies—network service, database service, and repository—and address the lack of configurability and reusability by planning configurable dependencies via constructor or external inputs.
Improve previous Android projects by passing dependencies through the constructor, replacing hardcoded values with constructor parameters for database and network services, boosting configurability and reusability.
Implement a singleton design to create one instance each of database and network services in a custom application class, reducing memory usage and preventing leaks.
Learn inversion of control and dependency injection by never creating dependencies inside classes, instead providing services and repositories from the outside through constructors.
Implement inversion of control in an Android app by injecting a database service and network service through a repository constructor, created externally and wired via view model and main activity.
Learn how to externalize dependencies with Dagger 2 by implementing application and activity components, injecting database and network services, and boosting testability and configurability of Android apps.
Explore how Dagger automates dependency creation and management by teaching modules, components, and providers, and show how repositories, database, and network service are supplied to consumers.
Learn the basic Dagger annotations, including module, provides, component, singleton, and inject, and see how to declare providers for models and inject dependencies into view models, database, and network services.
Learn how to add Dagger dependencies to your Gradle project, choose implementation over api for performance, and configure kapt annotation processing to enable Dagger modularization.
Create a Dagger module to provide database and network services within an application module using @Module and @Provides, then request dependencies via field injection.
Learn how to create an application component with Dagger 2, wire it to an application module, and inject a service and a network service instance in an Android app.
Learn to configure Dagger dependency injection by creating an application component and module, builder, and inject methods to supply database, network services, and API key in an Android app.
See how dagger performs dependency injection behind the scenes, wiring database and network services through the application module and generated components. Observe inject and factory code creating service instances.
Learn how Dagger singleton ensures a single instance of heavy services across the app lifecycle, preventing multiple database and network service instances by applying singleton scope on the application component.
Wire the main view model dependencies via an activity module and component, providing the repository, database service, and network service to the main activity, and ensure these services are singletons.
Learn how to share a single instance of service and network service across the app using Dagger 2, the application component, and module dependencies, and why scope matters.
Apply dagger 2 custom scoping to manage shared instances across application and activity components, exposing database and network services from the application component for use within the activity scope.
Learn to set up the application component in Dagger 2, connect it with the activity component, and expose single instances of service and network service for consistent injection.
Implement dagger 2 dependency injection in the main activity by creating an activity module with a provide function for the view model, repository, database service, and network service, then inject.
Implement a singleton repository in the application model to provide a single shared repository across components via dependency injection, ensuring the same instance is used by activities and view models.
Adopt Dagger constructor injection by moving from field injection to constructor wiring. Inject the repository into the main view model and remove old providers.
Explore repository constructor injection in Android using dagger 2, ensuring a single repository instance with singleton scope and applying constructor injection to services and network services.
Implement constructor injection for the database service with Dagger 2 and configure the application module to provide context and the database name, validating the singleton instance.
Explore constructor injection for a network service with dagger 2, configuring the application module to provide api key and context, and learn how a qualifier resolves string binding conflicts.
Discover how Dagger 2 qualifiers distinguish identical types, create custom qualifier annotations with retention, and inject API keys and database names in a DI setup.
Conclude this course by recapping dependencies, constructor injection, singletons, and inversion of control, then review the dependency component and dagger qualifiers for practical dagger usage.
In this course we will learn android dependency injection from scratch. In the first section of the course we will learn dependency injection by creating different project and implementing a best practice in dependency injection. In the second section of this course we will learn about the Dagger 2 and android dependency injection with dagger in a practical way.
This course is for anyone who is interested in learning Android Dependency Injection With Dagger. By the end of the course you will have a good understanding about dependency injection and Dagger 2.