SPsanjay prajapatinsanjayprajapat.hashnode.dev·Mar 5, 2022 · 3 min readKotlin Koin - Android Tutorial for BeginnersWhat is Koin? A pragmatic lightweight dependency injection framework for Kotlin developers Written in pure Kotlin. What is dependency and dependency Injection? Let’s take an example. We have a relation between Car and Engine classes. To access Engine...00
SPsanjay prajapatinsanjayprajapat.hashnode.dev·Nov 20, 2021 · 2 min readFunctional (SAM) interfaces in KotlinAn interface with only one abstract method is called a functional interface(Single Abstract Method). functional (SAM) interface can have multiple non abstract method but only one abstract method // functional interface example interface CatchAble {...00
SPsanjay prajapatinsanjayprajapat.hashnode.dev·Nov 14, 2021 · 2 min readHow To Combine Flows In KotlinCoroutines provides combine, zip and flattenMerge operators is used to combine emissions from multiple flows Combine Combine operator takes the latest emission from two flows and gives result import kotlinx.coroutines.* import kotlinx.coroutines.f...00
SPsanjay prajapatinsanjayprajapat.hashnode.dev·Oct 7, 2021 · 1 min readType Aliases in kotlintype alias provide alternative name for existing type. if type name is longer can be introduces shorter name , it will not introduced new types, they are equivalent to corresponding types. data class User( val name:String? = null, ) // alias fo...00
SPsanjay prajapatinsanjayprajapat.hashnode.dev·Sep 8, 2021 · 2 min readData class in KotlinThe main purpose of data class is hold data , in koltin compiler automatically creates following getters and setters for the constructor parameters - hashCode() equals() toString() copy() componentN() function following condition should be fullf...00