2024-09-01から1ヶ月間の記事一覧
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. Usually we define the dagger component in custom application class, which will init before any activity. 1. Create Custom Application Class class SmartPhoneApplication: Appl…
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. Please read this article first. If the MemoryCardModule has a parameter memorySize, @Module class MemoryCardModule(private val memorySize: Int) { @Provides fun providesMemor…
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. In this article we introduced created an abstract function getSmartPhone() and call it to get SmartPhone instance. We can also inject it into another class. This article I'l…
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. Please read last article before reading this one. Assuming class SmartPhone has another dependency Battery, and Battery is an interface, NickelCadmiumBattery is its implemen…
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. In last article we mentioned we need to add @Inject before dependency class's constructor. However some classes might came from 3rd party library, then we cannot modify them…
This is my note for Udemy lesson: Advanced Android Bootcamp 2024. 1. Import Dagger Please check this note 2. Change Class's Constructor Before: class SmartPhone(...) { ... } After: class SmartPhone @Inject constructor(...) { ... } 3. Creat…