Hilt ViewModels and Dependency Injection
Offered By: CodingWithMitch via YouTube
Course Description
Overview
Learn how to implement dependency injection into ViewModels using Hilt in Android development. Explore the advantages of constructor injection over field injection and discover how Hilt simplifies ViewModel instantiation in Fragments and Activities. Master the "by viewModels()" method for maintaining ViewModel instances in Fragments and the "by activityViewModels()" method for sharing ViewModels across multiple Fragments with a common host Activity. Follow along with practical examples and gain insights into efficient package structuring, ViewModel building, and dependency injection techniques for Android applications.
Syllabus
Introduction
Dependency Injection
Package Structure
Building the ViewModel
Using ViewModelInject
Using Dependency Injection
Sharing ViewModels
Outro
Taught by
CodingWithMitch
Related Courses
AngularJS: Framework FundamentalsMicrosoft via edX Архитектура Android-приложений
Moscow Institute of Physics and Technology via Coursera Client-based Web Applications development: ReactJS & Angular
Universidad Politécnica de Madrid via Miríadax Getting Started with Blazor Server
Coursera Project Network via Coursera Getting Started with Blazor WASM
Coursera Project Network via Coursera