Hilt (2) 썸네일형 리스트형 [Android] Hilt: Dependency Injection Made Easy 주의! 본 포스팅은 ChatGPT를 통해 만들었습니다 Caution! This Posting was made with ChatGPT Using Hilt for Dependency Injection in Android As your Android app grows in complexity, you may find yourself dealing with dependencies between classes that are hard to manage and test. One solution to this problem is to use a dependency injection (DI) framework to help manage your dependencies and make your code more modu.. [Android] Dagger & Hilt ViewModelFactory Dagger를 통해 DI 구현 중 ViewModelProvider.Factory를 의존성 주입하여 구현하는 방법을 정리해본다. 코드들은 Kotlin으로 작성했다. import androidx.lifecycle.ViewModel import dagger.MapKey import java.lang.annotation.* import java.lang.annotation.Retention import java.lang.annotation.Target import kotlin.reflect.KClass @Documented @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @MapKey annotation class ViewModelKey(val .. 이전 1 다음