SKILL Instructions

Android Hilt Dependency Injection

Wire Android apps with Hilt

claude
cursor
chatgpt
#android
#hilt
#di
#architecture

About

How to structure Hilt modules, scopes, and entry points for Android apps.

Metadata (SKILL.md frontmatter)

name
android-hilt-di
version
1.0.0

Instructions

Hilt DI

  • Annotate app with @HiltAndroidApp.
  • Use @AndroidEntryPoint on Activities/Fragments.
  • Provide bindings in @Module @InstallIn(SingletonComponent::class).
  • Prefer constructor injection; avoid @Inject lateinit var when possible.
  • Scope: @Singleton for repositories, @ViewModelScoped for use cases tied to a screen.