In part 5 of the Dagger 2 tutorial, we will learn how to use modules and provider methods to add objects to the dependency graph that can't use an @Inject constructor, like classes that belong to 3rd party libraries.
Modules are simple Java classes that we annotate with @Module and add to a component. They contain methods that are annotated with @Provides and which define how objects get instantiated and configured. These provider methods can have their very own dependencies as arguments, which Dagger will then provide if possible. By making provider methods static, we can get a performance boost because our component doesn't have to instantiate the module to call them.
Watch the whole playlist:
• Playlist
Example code for this part:
https://gist.github.com/codinginflow/...
____________________
💻 Find the BEST programming tutorials on TutHub:
https://tuthub.io
⭐ Get my MVVM Caching Course now:
https://codinginflow.com/caching
❗ Subscribe to the channel:
/ codinginflo. .
📨 Subscribe to the Coding in Flow newsletter:
https://codinginflow.com/newsletter
❓ Join our free developer community:
/ discord
📣 Follow Coding in Flow on other sites:
Facebook: / codinginflow
Instagram: / codinginflow
TikTok: / codinginflow
Twitter: / codinginflow
Github: https://github.com/codinginflow
💰 Business requests, sponsoring, etc.: info@codinginflow.com
In questa pagina del sito puoi guardare il video online Dagger 2 Tutorial Part 5 - MODULES & PROVIDER METHODS - Android Studio Tutorial della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Coding in Flow 17 gennaio 2019, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 66,762 volte e gli è piaciuto 1.8 mille spettatori. Buona visione!