android : @AndroidEntryPoint and @HiltViewModel usage
@AndroidEntryPoint is an annotation used in Hilt, which is Google’s recommended library for Dependency Injection (DI) built on top of Dagger. What does it actually do? When you mark a class with @AndroidEntryPoint, Hilt generates an individual Hilt component for that specific Android class (in this case, your MainActivity). Member Injection: It allows the class to receive dependencies from Hilt. Without this, you couldn't use the @Inject annotation to get your ViewModels, Repositories, or API services into the Activity. Lifecycle Management: It ensures that the dependencies are tied to the Activity's lifecycle. Hilt will automatically handle creating the component in onCreate() and destroying it when the Activity is destroyed. There are a few things to remember how to use this. We need to use viewModel delegate @dagger.hilt.android.AndroidEntryPoint class MainActivity : ComponentActivity() { private val viewModel : HomeViewModel by viewModels () override fun onCreate (...