Android Dependency Injection
Dependency Injection with Hilt and Dagger: @Inject, @Module, @Provides, Scopes, Qualifiers, Testing
15 面接問題·
Mid-Level
1What is Dependency Injection (DI)?
1
What is Dependency Injection (DI)?
回答
Dependency Injection is a pattern that provides a class's dependencies from the outside rather than creating them inside. This improves testability, modularity and reduces coupling between components.
2What is Hilt?
2
What is Hilt?
回答
Hilt is a DI library built on top of Dagger 2, specifically designed for Android. It simplifies DI configuration with standard annotations and automatically manages Android components (Activities, Fragments, ViewModels).
3What is the @HiltAndroidApp annotation used for?
3
What is the @HiltAndroidApp annotation used for?
回答
@HiltAndroidApp is applied on the Application class and triggers Hilt code generation. It creates the application root component and enables dependency injection throughout the app. Required to use Hilt.
4
What is the @AndroidEntryPoint annotation used for?
5
What is the @Inject annotation used for?
+12 面接問題
その他のAndroid面接トピック
Android Fundamentals
Junior
24問Android UI and Resources
Junior
30問Android Lifecycle
Junior
30問Android Navigation
Junior
26問Android Data Management
Junior
29問Android Networking
Junior
29問Android Testing
Junior
28問Android Gradle
Junior
26問Kotlin Language Essentials for Android
Junior
24問Room Database
Mid-Level
25問Background Work
Mid-Level
18問Jetpack Compose
Mid-Level
28問Permissions and Device Features
Mid-Level
21問Firebase for Android
Mid-Level
23問Android MVVM Architecture
Mid-Level
18問Advanced Android Networking
Mid-Level
13問Kotlin Collections and Operators
Mid-Level
20問Kotlin Coroutines and Flow
Mid-Level
20問Android MVI Architecture
Mid-Level
17問Android Clean Architecture
Senior
21問Android Compose Advanced
Senior
17問Android Performance and Monitoring
Senior
13問Android Security and Privacy
Senior
18問Android CI/CD and Release
Senior
15問Android UX and Form Factors
Senior
18問Android Testing Advanced
Senior
18問