Hello, Habr. For future students of the course "Android Developer. Professional" prepared a traditional translation of the material.
We also invite everyone to the webinar on the topic "Profiling and speeding up Gradle builds" . During the lesson, the participants, together with an expert:
- learn how to find bottlenecks in assemblies using gradle-profiler, scan and visualVM;
- learn how to properly configure Gradle;
- will consider other possibilities for optimizing and speeding up assemblies on a large project.
Dagger and Koin are without a doubt the two most popular dependency injection frameworks on Android. Both of these libraries serve the same purpose and seem very similar, but they work in different ways.
Hilt? Hilt โ , Dagger , , Dagger, Hilt.
, . , , .
Dagger
, Dagger - , , , @Inject
.
, Dagger (Factory) . , โ CompositeAdapter
, CompositeAdapter_Factory
.
, CompositeAdapter
.
, get()
, CompositeAdapter
. , Provider, . Provider .
, Hilt Dagger?
. Hilt โ , Dagger , , , Dagger. Hilt, , Dagger , . .
Koin
Koin , Dagger , , Hilt. Koin, , Koin . , , .
Koin InstancesRegistry
, , .
map โ , , . โ , .
, , , get()
(, ) inject()
, get()
. get()
, , .
?
, Dagger , Koin โ .
1.
Dagger โ , - , , .
, @Inject
CompositeAdapter
, , , .
Koin . , CompositeAdapter
, , RuntimeException
, . , , , - - .
2.
, Koin , : . Dagger . .
3.
, Koin , .
, Dagger . , Koin , . Dagger , Koin.
, , , . Koin Dagger , . , , , , Dagger Koin, , -, , . , : Koin, Dagger Hilt .
, , , , , .
- "Android Developer. Professional".
- "Android Developer. Basic".