AAndroid Expert·Nov 2Why Your Flow Refuses to Hop Threads: Context Preservation, flowOn, and channelFlow in KotlinWhy withContext breaks flow { } in Kotlin. Learn context preservation, when to use flowOn or channelFlow, and the Android failures that crash apps.11 min read·android-expert.hashnode.dev1
AAndroid Expert·Nov 2Dropped on the Floor: Conflation in Kotlin Flows and the UI Events You Never SawLearn how Kotlin Flow conflation drops events in StateFlow, SharedFlow, and collectLatest, and fix it with Channels, buffers, and tested patterns.11 min read·android-expert.hashnode.dev
Kkigya·May 2Don't Bury Your Backing PropertiesLearn why explicit backing fields do not fully replace backing properties and asStateFlow for safer ViewModel state in Kotlin Android apps.12 min read·kigya.hashnode.dev1
GGanesh Rama Hegde·Feb 21Chapter 30 : UseCase27 - Flow Cancellation & Cooperative Cancellation Flow cancellation is not an optional feature. It is a core part of how coroutines are designed to behave. When a collector stops collecting, the entire upstream flow is cancelled automatically. This i6 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 21Chapter 29 : UseCase26 - Channels and Flow BridgeNow we do one level below Flow. Flow is built on coroutines.Coroutines are built on channels. Here we convert channel to Flow and build Flow using channelFlow. We also understand producer-consumer in4 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 20Chapter 27 : UseCase24 - StateFlow (State Holder Semantics)What is StateFlow? StateFlow is a special type of SharedFlow that: Always holds a current value Requires an initial value Replays the latest value to new collectors Conflates updates automatically3 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 20Chapter 28 : UseCase25 - Hot vs Cold Flow comparisonIn this use case we will do an architectural level comparison of hot versus cold flow. CODE IMPLEMENTATION package org.kotlinflowlearner.stockflow.usecases.uc25 import kotlinx.coroutines.flow.* impor4 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 19Chapter 26 : UseCase23 - SharedFlow (Hot Streams)Everything that we have seen until now was cold flows. Now we enter the world of "hot” flows. Cold flow means: Nothing runs until collected Each collector gets its own independent execution Flow re4 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 19Chapter 25 : UseCase22 - Context Switching with flowOnIn this chapter we answer the core question : If Flow is sequential, then how do we control which thread executes which part? That’s what flowOn does. Flow is context-preserving by default. It means t2 min read·kotlinflow.hashnode.dev
GGanesh Rama Hegde·Feb 18Chapter 24 : UseCase21 - Conflation Deep Divebuffer() in Chapter 23 was all about “queue everything” when the consumer is slow. Now we look into conflate() which is all about “dropping intermediate values” and caring only about the latest value. The Core Idea When the consumer is slow: buffer(...3 min read·kotlinflow.hashnode.dev