# kotlin-flow

Kotlin Flow is an asynchronous data-stream abstraction that sequentially emits values and completes normally or with an exception.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How Kotlin Flow Operator Fusion Works and When Ordinary Operators Break It

DevFeed: [How Kotlin Flow Operator Fusion Works and When Ordinary Operators Break It](<https://devfeed.tech/articles/i-counted-every-hidden-channel-kotlin-flow-creates-most-devs-are-wrong-about-which-operators-are-22947.md>)

Original publisher: [Read original article](<https://proandroiddev.com/i-counted-every-hidden-channel-kotlin-flow-creates-most-devs-are-wrong-about-which-operators-are-8f38cf676e07?source=rss----c72404660798---4>)

Author: Majidshahbaz

Published: 2026-09-13T05:43:21Z

Content type: article

Language: en

Sources: [ProAndroidDev - Medium](<https://devfeed.tech/sources/proandroiddev-medium.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code](<https://devfeed.tech/tags/code.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>)

### AI overview

This article investigates Kotlin Flow operator fusion by instrumenting the runtime and comparing pipelines with adjacent fusible operators against pipelines interrupted by an ordinary map() call. It explains that adjacent channelFlow, flowOn, buffer, and produceIn calls can share one underlying channel through FusibleFlow, while an intervening non-fusible operator causes additional wrapper structure.

### Source excerpt

Image Generated for the ArticleI Counted Every Hidden Channel Kotlin Flow Creates -- Most Devs Are Wrong About Which Operators Are Freebuffer() and flowOn() are supposed to fuse into one channel when chained. I wrote code to prove it -- and then found four "harmless" operators that quietly break it. Ask any experienced Kotlin developer what happens when you chain .buffer().flowOn(Dispatchers.IO).buffer(), and you'll usually get a confident answer: "it fuses into one channel." That's the folklore, repeated in talks, docs, and Stack Overflow answers. It's also only half true, and nobody seems to have actually checked the other half: which everyday operators quietly stop that fusion from happening. I decided to stop trusting folklore and instrument the actual runtime. Five separate experiments later, I had a very clear, very measurable answer -- and one of the results genuinely surprised me. The Myth, and the Mechanism Behind It Kotlin's coroutines library really does fuse adjacent channelFlow, flowOn, buffer, and produceIn calls into a single underlying channel instead of creating one per operator. This isn't a rumor -- it's real, deliberate behavior, implemented through an interface called FusibleFlow. Here's the actual check, straight from the source: https://medium.com/media/1cd3b407c1f2b2955b3df4be68ca18b5/href When flowOn() or buffer() is called, it checks whether the flow it's being called on already implements FusibleFlow. If it does, instead of wrapping it in a new object, it calls .fuse() -- which updates the existing object's settings (buffer size, dispatcher) in place. No new object. No new coroutine. No new channel. But that check only succeeds if the upstream is already a ChannelFlow. And that's where the folklore quietly stops being true. Building Something to Actually Measure This I wrote two nearly identical pipelines -- one where the fusible operators sit directly next to each other, and one where a completely ordinary map() sits in the middle: https://medi

## A Kotlin Flow Guessing Game

DevFeed: [A Kotlin Flow Guessing Game](<https://devfeed.tech/articles/flow-guessing-game-39313.md>)

Original publisher: [Read original article](<https://kt.academy/article/game-flow>)

Published: 2026-03-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [fun](<https://devfeed.tech/tags/fun.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A game designed to test and strengthen understanding of Kotlin Flow.

### Source excerpt

A fun game that pushes your understanding of Kotlin Flow.

## Kotlin Flow to RxJava or Reactor and vice versa

DevFeed: [Kotlin Flow to RxJava or Reactor and vice versa](<https://devfeed.tech/articles/kotlin-flow-to-rxjava-or-reactor-and-vice-versa-39327.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-flows-to-streams>)

Published: 2025-09-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>), [interoperability](<https://devfeed.tech/topics/interoperability.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [interoperability](<https://devfeed.tech/tags/interoperability.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

A guide to converting Kotlin Flow to RxJava or Reactor streams and converting those streams back to Kotlin Flow. It covers interoperability libraries, extensions, coroutine-based stream creation, and handling single-value or no-value operations.

### Source excerpt

A guide on how to convert Kotlin Flow to RxJava or Reactor streams and vice versa.

## Kotlin Coroutines and Swift

DevFeed: [Kotlin Coroutines and Swift](<https://devfeed.tech/articles/kotlin-coroutines-and-swift-39324.md>)

Original publisher: [Read original article](<https://kt.academy/article/interop-coroutines-swift>)

Published: 2025-09-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Structured concurrency](<https://devfeed.tech/topics/structured-concurrency.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [async](<https://devfeed.tech/tags/async.md>), [cancellation](<https://devfeed.tech/tags/cancellation.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>), [swift](<https://devfeed.tech/tags/swift.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how to bridge Kotlin Coroutines and Swift's async/await and structured concurrency in Kotlin Multiplatform iOS projects. It covers suspending functions, exception conversion, Kotlin Flow to AsyncSequence, and calling Swift async functions from Kotlin.

### Source excerpt

How to use Kotlin Coroutines in Swift projects, or Swift libraries from Kotlin Coroutines.

## Understanding Kotlin Flow flatMapMerge behavior

DevFeed: [Understanding Kotlin Flow flatMapMerge behavior](<https://devfeed.tech/articles/flatmapmerge-is-weird-39307.md>)

Original publisher: [Read original article](<https://kt.academy/article/flat_map_merge>)

Published: 2024-03-06T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [fetch](<https://devfeed.tech/tags/fetch.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This article explains surprising aspects of Kotlin Flow's flatMapMerge, including its synchronous transformation step, default concurrency limit of 16, and inconsistent behavior when the concurrency is set to 1. It examines the implementation and presents patterns for handling asynchronous transformations.

### Source excerpt

How not to get surprised by flatMapMerge behavior.

## Collecting items from the Flow in chunks💦

DevFeed: [Collecting items from the Flow in chunks💦](<https://devfeed.tech/articles/collecting-items-from-the-flow-in-chunks-25706.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/collecting-items-from-the-flow-in-chunks/>)

Author: Shreyas Patil

Published: 2023-10-23T04:46:23Z

Content type: tutorial

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>)

Tags: [collect](<https://devfeed.tech/tags/collect.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [flow](<https://devfeed.tech/tags/flow.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [multithreading](<https://devfeed.tech/tags/multithreading.md>), [reactive-programming](<https://devfeed.tech/tags/reactive-programming.md>)

### AI overview

A practical guide to collecting Kotlin Flow items in time-based chunks without losing produced data. It explains why batching high-frequency analytics events can reduce the cost of repeated database or network operations and outlines an operator implementation.

### Source excerpt

Learn how to collect Kotlin Flow items in chunks or intervals without losing data. A practical guide to handling high-frequency data streams efficiently.

## Strategies for automatically refreshing data on Android using Kotlin Flow

DevFeed: [Strategies for automatically refreshing data on Android using Kotlin Flow](<https://devfeed.tech/articles/strategies-for-automatically-refreshing-data-on-android-using-kotlin-flow-25884.md>)

Original publisher: [Read original article](<https://bladecoder.medium.com/strategies-for-automatically-refreshing-data-on-android-using-kotlin-flow-cd23ba7cfbe0?source=rss-54910f05af37------2>)

Author: Christophe Beyls

Published: 2023-10-06T17:27:03Z

Content type: tutorial

Language: en

Sources: [Stories by Christophe Beyls on Medium](<https://devfeed.tech/sources/stories-by-christophe-beyls-on-medium.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [api](<https://devfeed.tech/tags/api.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [sharedflow](<https://devfeed.tech/tags/sharedflow.md>), [ui](<https://devfeed.tech/tags/ui.md>)

### AI overview

This tutorial explains how to periodically refresh data in Android user interfaces with Kotlin Flow. It compares sequential map() processing with concurrent, cancellation-aware mapLatest() processing and discusses lifecycle-aware refreshing and caching considerations.

### Source excerpt

Making timers lifecycle-aware This is the third part of a series of articles discussing the usage of Kotlin Flow to efficiently load data in Android applications. It's a direct follow-up to part 2: "Smarter Shared Kotlin Flows", as it reuses the same concepts to cover another use case: automatic periodic refresh of the user interface. Simple periodic refresh When it's not possible to determine precisely when a data set displayed by the UI has changed, or when it changes too frequently, a common strategy is to reload the data periodically at a fixed interval while the screen is visible. One of the simplest ways to achieve this is to create a Flow from an infinite loop calling delay() between emissions: fun tickerFlow(period: Duration): Flow<Unit> = flow { while (true) { emit(Unit) // Tick delay(period) } } This is equivalent to the Observable.interval() operator in RxJava with a fixed emitted value (Unit) and an initial delay of 0. Then, transform this Flow using the map() or mapLatest() operator to perform the loading action on each "tick" of the timer and return the result: tickerFlow(REFRESH_INTERVAL) .map { repository.loadSomeData() } Note the subtle difference in behavior between the two operators: With map() the entire Flow will be executed in sequence within a single coroutine, meaning delay() will only start running after the loading operation completes. As a result, each loading operation will be delayed by the amount of time it took to perform the previous loading operation, plus the fixed interval. With mapLatest() the main coroutine will collect the upstream values of tickerFlow() while a child coroutine will be created to perform the loading operation concurrently and collect the result without suspending the main coroutine. This means that delay() will start running immediately after the previous tick and each loading operation will start precisely according to schedule. This also means that the interval must be longer than the typical loading time beca

## PermissionFlow: A Reactive API for knowing the status of Android app permissions

DevFeed: [PermissionFlow: A Reactive API for knowing the status of Android app permissions](<https://devfeed.tech/articles/permissionflow-a-reactive-api-for-knowing-the-status-of-android-app-permissions-25740.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/permissionflow-a-reactive-api-for-knowing-the-status-of-android-app-permissions/>)

Author: Shreyas Patil

Published: 2023-05-22T05:19:08Z

Content type: tutorial

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Library](<https://devfeed.tech/topics/library.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [permission](<https://devfeed.tech/tags/permission.md>), [reactive](<https://devfeed.tech/tags/reactive.md>)

### AI overview

PermissionFlow is an open-source Android library that provides a reactive API for tracking permission states across app modules. The article explains how it can notify subscribers of permission changes, including changes made in app settings, and describes Kotlin Flow, testing, and Jetpack Compose support.

### Source excerpt

Introduction to PermissionFlow: A reactive API for Android that simplifies tracking permission status changes using Kotlin Coroutines and Flow.

## Reactive streams testing

DevFeed: [Reactive streams testing](<https://devfeed.tech/articles/reactive-streams-testing-38654.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2023_01_08_reactive_streams_testing/>)

Published: 2023-01-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [API](<https://devfeed.tech/topics/api.md>), [Documentation](<https://devfeed.tech/topics/documentation.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [callback](<https://devfeed.tech/topics/callback.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This article explains how to test reactive-stream APIs, using RxJava and Kotlin Flow as examples. It emphasizes testing emitted values and other implicit behavior so tests document public API expectations and support safer migrations and refactoring.

### Source excerpt

Introduction We should test the code to guarantee that it does exactly what it is expected to do. Tests not only verify correctness of the program but also set expectations. This becomes especially useful for public API, where tests can be treated as part of documentation that describes not only results but also behavior. Such things help do less painful migrations and refactoring as it becomes clear what behaviors are changing and what we should do about that.

## Kotlin Coroutines Course Adds Kotlin Flow Modules for Android Development

DevFeed: [Kotlin Coroutines Course Adds Kotlin Flow Modules for Android Development](<https://devfeed.tech/articles/my-coroutines-course-just-got-a-big-update-kotlin-flow-for-android-development-25417.md>)

Original publisher: [Read original article](<https://www.lukaslechner.com/my-coroutines-course-just-got-a-big-update-kotlin-flow-for-android-development/>)

Author: Lukas Lechner

Published: 2022-11-21T14:57:43Z

Content type: release

Language: en

Sources: [Lukas Lechner](<https://devfeed.tech/sources/lukas-lechner.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [android-development](<https://devfeed.tech/topics/android-development.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>)

Tags: [allgemein](<https://devfeed.tech/tags/allgemein.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [course](<https://devfeed.tech/tags/course.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>)

### AI overview

The author announces an update to an existing Kotlin Coroutines course for Android, adding modules about Kotlin Flow. The update includes 6 hours of video content, bringing the course to 15 hours in total.

### Source excerpt

Hi Readers 👋 There hasn't been a lot of news from my side lately, but today I can announce something big! I spent the last months extending my already existing Course about Kotlin Coroutines for Android with modules about Kotlin Flow! The result is an additional 6 hours of video content about Kotlin Flow, making Read More The post My Coroutines Course just got a BIG update: Kotlin Flow for Android Development first appeared on Lukas Lechner.

## Using Coroutines and Flows with Firebase on an Android app

DevFeed: [Using Coroutines and Flows with Firebase on an Android app](<https://devfeed.tech/articles/using-coroutines-and-flows-with-firebase-on-an-android-app-16483.md>)

Original publisher: [Read original article](<https://firebase.blog/posts/2022/10/using-coroutines-flows-with-firebase-on-android>)

Author: Marina Coelho

Published: 2022-10-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Firebase Blog](<https://devfeed.tech/sources/firebase-blog.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Android](<https://devfeed.tech/topics/android.md>), [Compose](<https://devfeed.tech/topics/compose.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [compose](<https://devfeed.tech/tags/compose.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [flow](<https://devfeed.tech/tags/flow.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>)

### AI overview

A tutorial on replacing callback-based Firebase service calls with Kotlin Coroutines and Kotlin Flow in an Android application built with Jetpack Compose. It covers Firebase Authentication and Cloud Firestore examples.

### Source excerpt

Learn how to use Kotlin Coroutines and Kotlin Flows with Firebase on an Android app built with Jetpack Compose.

## Smarter Shared Kotlin Flows

DevFeed: [Smarter Shared Kotlin Flows](<https://devfeed.tech/articles/smarter-shared-kotlin-flows-25883.md>)

Original publisher: [Read original article](<https://bladecoder.medium.com/smarter-shared-kotlin-flows-d6b75fc66754?source=rss-54910f05af37------2>)

Author: Christophe Beyls

Published: 2022-06-06T16:44:02Z

Content type: tutorial

Language: en

Sources: [Stories by Christophe Beyls on Medium](<https://devfeed.tech/sources/stories-by-christophe-beyls-on-medium.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [database](<https://devfeed.tech/tags/database.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [livedata](<https://devfeed.tech/tags/livedata.md>), [sharedflow](<https://devfeed.tech/tags/sharedflow.md>)

### AI overview

This second article in a Kotlin Flow on Android series explains how SharedFlow and StateFlow using SharingStarted.WhileSubscribed() can restart upstream work when a lifecycle becomes active again. It compares this behavior with lifecycle-aware LiveData and proposes designing a Flow operator that propagates lifecycle state upstream to avoid unnecessary network requests or database queries.

### Source excerpt

Make the lifecycle available to the upstream Flow to skip unnecessary work This is the second part of a series of articles about using Kotlin Flow on Android. In the first part, we described the main limitation of Kotlin Flow when used inside ViewModel classes: When a SharedFlow or StateFlow using the SharingStarted.WhileSubscribed() strategy is collected again after the user navigates back to an Activity or Fragment, its source upstream Flow will always restart from scratch, sometimes resulting in unnecessary work being performed when the previously cached data was still valid. val results: StateFlow<SearchResult> = queryFlow.mapLatest { query -> repository.search(query) }.stateIn( scope = viewModelScope, started = SharingStarted.WhileSubscribed(5000L), initialValue = SearchResult.EMPTY ) In the above example, repository.search() will be executed again even if the latest value of queryFlow didn't change in the meantime. This means a potential unnecessary network request or database query. LiveData doesn't suffer from this issue because its observers don't need to unsubscribe when they become inactive: LiveData is lifecycle-aware and will postpone the delivery of new results until it becomes active, while also ensuring that the same result will never be delivered to the same observer twice (even when it becomes active again). For more details I invite you to read the full article. At the end of this first part, we concluded that there was no simple and correct way to avoid performing this unnecessary work when relying only on the standard shareIn() or stateIn() operators. In this second part, we are going to solve that efficiency problem by designing a new Flow operator that will allow SharedFlows to integrate better with the lifecycle. Synchronizing with the LifecycleLiveData The core reason why LiveData deals with lifecycles better than Flow is because the lifecycle state is automatically propagated upstream through all the LiveData instances so they can all pause

## Kotlin Flow Notes: Producers, Consumers, Operators, and Hot and Cold Flows

DevFeed: [Kotlin Flow Notes: Producers, Consumers, Operators, and Hot and Cold Flows](<https://devfeed.tech/articles/flow-notes-32051.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/flow-notes/>)

Published: 2022-04-27T16:16:06Z

Content type: tutorial

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Large Screen](<https://devfeed.tech/topics/large-screen.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [article](<https://devfeed.tech/tags/article.md>), [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [cheat-sheet](<https://devfeed.tech/tags/cheat-sheet.md>), [code](<https://devfeed.tech/tags/code.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [coroutines-flow](<https://devfeed.tech/tags/coroutines-flow.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [sharedflow](<https://devfeed.tech/tags/sharedflow.md>), [sketch-note](<https://devfeed.tech/tags/sketch-note.md>), [stateflow](<https://devfeed.tech/tags/stateflow.md>), [streams](<https://devfeed.tech/tags/streams.md>)

### AI overview

A set of companion sketch notes about Kotlin Flow, covering suspend functions, streams of multiple values, producers and consumers, terminal and transform operators, execution contexts, hot and cold flows, and Android usage.

### Source excerpt

This post is my companion sketch notes for all the resources I consumed on the topic of flows. It is not meant to replace the info that I found on the internet but rather supplement it. Nor is it complete or should it be a standalone guide. In fact you can find an excellent list of my favourite resources at the end of the article. It is a document that helps me make sense of the topic. With that disclaimer out of the way... Let's take a step back and look at the suspend function. If your coroutine knowledge is rusty, freshen that up first. What if we want to provide multiple values? A stream of values that can be observed? Enter flows. At their most basic, flows have a producer and a consumer. The interface looks like this (spoiler it's just suspend functions under the hood) The consumer gets the multiple values by using a terminal operator. If I need to change the produced values along the way before consuming them, there are transform operators. How do I switch from main to io context? What's with the hot and cold flows? How do I remember which is which? Some practical hot flows. Flows on Android References Kotlin Coroutines Flow in a nutshell Kotlin Flows ~ an Android cheat sheet Kotlin Flows in Android summary Android flow Asynchronous Flow | Kotlin Flow under the hood: how does it really work KotlinConf 2019: Asynchronous Data Streams with Kotlin Flow by Roman Elizarov Kotlin Flows in a Nutshell FlowMarbles Android StateFlow and SharedFlow If you are reading this far I will reward you with an Android portait.

## QueryBuilder: How I wrote a runtime SQL query generator for an Android app

DevFeed: [QueryBuilder: How I wrote a runtime SQL query generator for an Android app](<https://devfeed.tech/articles/querybuilder-how-i-wrote-a-runtime-sql-query-generator-for-an-android-app-25682.md>)

Original publisher: [Read original article](<https://blog.sanskar10100.dev/querybuilder-how-i-wrote-a-runtime-sql-query-generator-for-an-android-app>)

Author: Sanskar Agrawal

Published: 2022-02-07T12:05:01Z

Content type: tutorial

Language: en

Sources: [Sanskar's Stuff](<https://devfeed.tech/sources/sanskar-s-stuff.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Object-relational mapping](<https://devfeed.tech/topics/orm.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [coding](<https://devfeed.tech/topics/coding.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app-development](<https://devfeed.tech/tags/app-development.md>), [coding](<https://devfeed.tech/tags/coding.md>), [database](<https://devfeed.tech/tags/database.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [orm](<https://devfeed.tech/tags/orm.md>), [room](<https://devfeed.tech/tags/room.md>), [sorting](<https://devfeed.tech/tags/sorting.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

A developer explains how an Android app called Transactions uses Room ORM over SQLite and Kotlin Flow, then describes the need for incremental sorting and filtering. The article compares filtering Kotlin lists with writing custom DAO methods for every query combination, motivating a runtime SQL query generator.

### Source excerpt

I've been building an app called Transactions for some time. As the name suggests, Transactions offers you the capability to track your income and expenses made through cash or digital mediums. I mostly wrote it for my personal use, but it caught on ...

## Kotlin property delegates for Datastore Preferences library

DevFeed: [Kotlin property delegates for Datastore Preferences library](<https://devfeed.tech/articles/kotlin-property-delegates-for-datastore-preferences-library-26020.md>)

Original publisher: [Read original article](<https://proandroiddev.com/kotlin-property-delegates-for-datastore-preferences-library-5d4e1cdb609b?source=rss-e93d234beac6------2>)

Author: Yahor Urbanovich

Published: 2021-08-23T15:40:08Z

Content type: tutorial

Language: en

Sources: [Stories by Yahor Urbanovich on Medium](<https://devfeed.tech/sources/stories-by-yahor-urbanovich-on-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Library](<https://devfeed.tech/topics/library.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [migration](<https://devfeed.tech/topics/migration.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [delegates](<https://devfeed.tech/tags/delegates.md>), [delegation](<https://devfeed.tech/tags/delegation.md>), [deprecated](<https://devfeed.tech/tags/deprecated.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [library](<https://devfeed.tech/tags/library.md>), [migration](<https://devfeed.tech/tags/migration.md>), [property-delegation](<https://devfeed.tech/tags/property-delegation.md>), [suspend-function](<https://devfeed.tech/tags/suspend-function.md>)

### AI overview

This tutorial explains migrating preference storage from SharedPreferences to AndroidX DataStore Preferences. It shows how Kotlin property delegation can encapsulate reading and writing values, and how Flow, coroutines, first(), and runBlocking can support single-value access despite DataStore's Flow-based API.

### Source excerpt

Kotlin delegated property for Datastore Preferences library Recently AndroidX Datastore 1.0 was released. The moment has come, it's time to migrate away from SharedPreferences. As for me, the key benefit is the built-in support of Kotlin Flow and Coroutines. Previously we had to write our own wrapper under SharedPreferences.OnSharedPreferenceChangeListener, emit changes into ConflatedBroadcastChannel and then convert it into Flow. https://medium.com/media/b5410ce9df08d9b73427a2138a6b0a8d/href Firstly, this approach produces a lot of intermediate variables. Secondly, ConflatedBroadcastChannel deprecated and should be replaced with StateFlow. In this case, DataStore comes out as the winner. The migrated to DataStore version looks clean and simple. https://medium.com/media/cce0d485e2af9941e677dc7973a54c6f/hrefRead/write single value using SharedPreferences Let's imagine, we need to store the current App theme as String. For this purpose, we need to initialize SharedPreferences, then make two functions to read and write these values. https://medium.com/media/3bc9760a22ebd1071e4dcb21eaf8d4ba/href Well, two functions it is not so bad, but we can try to merge this into single Property. https://medium.com/media/c3babbf2b6c55bb18172f66ddc825b06/href To make it fully clear and supportable we can use the Kotlin delegation feature. As we want to read and write simultaneously, ReadWriteProperty will suit our goal. https://medium.com/media/80f370a5a5735b911c75d3a0f1d22b21/href Please take a look at the final compact version, where all logic is encapsulated inside the delegate. https://medium.com/media/39b5311b04373b1f31d3030b8b083587/hrefDataStore Preferences and missing API During migration, it turned out that the library doesn't provide an API for reading a single property. DataStore proposes to use Flow for all cases. Developers are now required to read/write the value in the scope of a suspend function. https://medium.com/media/e7c4e45e239e11bc5082f3997e5280dd/href What was e

## Kotlin flow: Nesting vs Chaining

DevFeed: [Kotlin flow: Nesting vs Chaining](<https://devfeed.tech/articles/kotlin-flow-nesting-vs-chaining-38649.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2021_07_08_kotlin_flow_nesting_vs_chaining/>)

Published: 2021-07-08T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>)

Tags: [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>)

### AI overview

A tutorial comparing nesting and chaining in Kotlin Flow reactive streams. It explains that chaining can improve readability for simple sequential streams, while nesting is useful for sharing data across streams and managing stream lifecycles, such as conditionally observing a user's location.

### Source excerpt

Introduction When it comes to reactive streams it is likely everyone heard about huge 'Rx-chains'. But reactive streams are not only about chaining but also about nesting. Let's find out what are they, what are the differences, and why it matters. We'll use Kotlin Flow throughout the article, but everything can be applied to RxJava as well. First of all, we need to come up with definitions. For that, we'll take a look at some simple streams.

## Android Room Hidden Costs

DevFeed: [Android Room Hidden Costs](<https://devfeed.tech/articles/android-room-hidden-costs-38643.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_12_18_android_room_hidden_costs/>)

Published: 2020-12-18T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Android](<https://devfeed.tech/topics/android.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [databases](<https://devfeed.tech/tags/databases.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>)

### AI overview

This article examines the hidden costs of using Android Room to support reactive streams. It explains how Room uses SQLite triggers and an internal invalidation table to detect changes, trigger callbacks, and automatically re-query data for observers.

### Source excerpt

Introduction Android Room is an awesome AndroidX library. It is great because it provides a clean way of how to deal with databases without introducing some heavy concepts. Out of the box with Room one gets: simplified code comparing with raw SQLite queries working via DAO interfaces and models instead of Cursors auto-generated "boilerplate" code for queries migration support Android Studio tooling (compile-time verification of queries and highlight) support for reactive streams (RxJava, Kotlin Flow) and more In this article, I'd like to discover some hidden costs Room applies to support reactive streams and how one can try to avoid them.

## Shared flows, broadcast channels

DevFeed: [Shared flows, broadcast channels](<https://devfeed.tech/articles/shared-flows-broadcast-channels-26027.md>)

Original publisher: [Read original article](<https://elizarov.medium.com/shared-flows-broadcast-channels-899b675e805c?source=rss-4762e889f8fc------2>)

Author: Roman Elizarov

Published: 2020-11-16T13:16:59Z

Content type: article

Language: en

Sources: [Stories by Roman Elizarov on Medium](<https://devfeed.tech/sources/stories-by-roman-elizarov-on-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Streams](<https://devfeed.tech/topics/streams.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [channel](<https://devfeed.tech/tags/channel.md>), [concurrent](<https://devfeed.tech/tags/concurrent.md>), [coroutine](<https://devfeed.tech/tags/coroutine.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [streams](<https://devfeed.tech/tags/streams.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

### AI overview

This article explains why Kotlin shared flows were introduced as a replacement for broadcast channels for distributing events and state updates to multiple subscribers. It contrasts channel-based transformations with Kotlin Flow, emphasizing the synchronization costs of channels and the efficiency of flow transformations.

### Source excerpt

Photo by Davies Designs Studio on Unsplash Once upon a time coroutines were introduced to Kotlin and they were lightweight. We could launch a multitude of coroutines and we needed a way to communicate between those coroutines without running into a dreaded "mutable shared state" problem. Thus Channel was added as an inter-coroutine communication primitive. The channels are wonderful. Channels support one-to-one, one-to-many, many-to-one, and many-to-many communication between coroutines, and every value that is sent to the channel is received once. Diagram of many-to-many channel operation You cannot use channels to distribute events or state updates in a way that allows multiple subscribers to independently receive and react upon them. Thus the BroadcastChannel interface was introduced with buffered and ConflatedBroadcastChannel as its implementations. They served us well for a while, but they turned out to be a design dead-end. Now, since kotlinx-coroutines version 1.4 we have introduced a better solution -- shared flows. Read on for the full story. Flows are simple In the early versions of the library, we had only channels and we tried to implement various transformations of asynchronous sequences as functions that take one channel as an argument and return another channel as a result. It means that, for example, a filter operator would run in its own coroutine. Diagram of filter operator with channels The performance of such an operator was far from great, especially compared to just writing an if statement. In a hindsight, it is not surprising, because a channel is a synchronization primitive. Any channel, even an implementation that is optimized for a single producer and a single consumer, must support concurrent communicating coroutines and a data transfer between them needs synchronization, which is expensive in modern multicore systems. When you start building your application architecture on top of the asynchronous data streams, the need to have transformat

## Kotlin Flow Compared with RxJava: Benefits and Trade-offs

DevFeed: [Kotlin Flow Compared with RxJava: Benefits and Trade-offs](<https://devfeed.tech/articles/the-real-kotlin-flow-benefits-over-rxjava-38638.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_05_17_the_real_kotlin_flow_benefits_over_rxjava/>)

Published: 2020-05-17T00:00:00Z

Content type: article

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>)

### AI overview

A follow-up analysis compares Kotlin Flow with RxJava, discussing claimed benefits, drawbacks, and trade-offs. The article examines channels, StateFlow, subjects, and experimental API compatibility.

### Source excerpt

Source Introduction Recently the article about Kotlin Flow benefits over RxJava was published by Antoni Castejón García: Kotlin Flow benefits over RxJava Though Antoni made a good work and many thanks to him for providing his feedback and experience (we need to share our thoughts, this improves community acknowledgment in various areas) -- I found few places in the article with which I don't fully or partially agree. Some points, in my opinion, were missing. So, I decided to make a follow-up feedback post on what I consider the real benefits of Kotlin Flow over RxJava. Feedback is also a good thing as it helps us to drive forward and maybe look at the same things from a different angle.

## Integrating Firebase Cloud Firestore with Kotlin Coroutines and Flow in Android

DevFeed: [Integrating Firebase Cloud Firestore with Kotlin Coroutines and Flow in Android](<https://devfeed.tech/articles/firebase-ing-with-kotlin-coroutines-flow-25722.md>)

Original publisher: [Read original article](<https://blog.shreyaspatil.dev/firebase-ing-with-kotlin-coroutines-flow-dab1bc364816/>)

Author: Shreyas Patil

Published: 2020-04-30T07:35:30Z

Content type: tutorial

Language: en

Sources: [Shreyas Patil's Blog](<https://devfeed.tech/sources/shreyas-patil-s-blog.md>)

Topics: [Firebase](<https://devfeed.tech/topics/firebase.md>), [Firestore](<https://devfeed.tech/topics/firestore.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/topics/kotlin-coroutines.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Android](<https://devfeed.tech/topics/android.md>), [reactive](<https://devfeed.tech/topics/reactive.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [firestore](<https://devfeed.tech/tags/firestore.md>), [flow](<https://devfeed.tech/tags/flow.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-coroutines](<https://devfeed.tech/tags/kotlin-coroutines.md>), [others](<https://devfeed.tech/tags/others.md>), [reactive](<https://devfeed.tech/tags/reactive.md>)

### AI overview

This tutorial demonstrates how to use Kotlin Coroutines and Flow with Firebase Cloud Firestore in Android. It explains Flow as a cold reactive stream and shows a repository-based approach for exposing loading, success, and failure states while retrieving posts.

### Source excerpt

Learn how to integrate Firebase with Kotlin Coroutines and Flow for reactive data streams in your Android applications.

## Kotlin Mumbai: Kotlin basics and Flows

DevFeed: [Kotlin Mumbai: Kotlin basics and Flows](<https://devfeed.tech/articles/kotlin-mumbai-kotlin-basics-and-flows-28376.md>)

Original publisher: [Read original article](<https://siddroid.com/post/post-april-kotlin-mumbai-2020/>)

Author: Siddhesh Patil

Published: 2020-04-27T13:26:47Z

Content type: article

Language: en

Sources: [Sid Patil - Android Engineer and Kotlin Advocate](<https://devfeed.tech/sources/sid-patil-android-engineer-and-kotlin-advocate.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Development](<https://devfeed.tech/topics/development.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [akshay-chordiya-gde-android](<https://devfeed.tech/tags/akshay-chordiya-gde-android.md>), [android-developers-in-mumbai](<https://devfeed.tech/tags/android-developers-in-mumbai.md>), [async](<https://devfeed.tech/tags/async.md>), [community](<https://devfeed.tech/tags/community.md>), [development](<https://devfeed.tech/tags/development.md>), [filip-babic-gde-in-kotlin](<https://devfeed.tech/tags/filip-babic-gde-in-kotlin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [kotlin-mumbai](<https://devfeed.tech/tags/kotlin-mumbai.md>), [kotlin-user-group-in-mumbai](<https://devfeed.tech/tags/kotlin-user-group-in-mumbai.md>), [kug](<https://devfeed.tech/tags/kug.md>), [programming](<https://devfeed.tech/tags/programming.md>), [talks-in-mumbai](<https://devfeed.tech/tags/talks-in-mumbai.md>)

### AI overview

A Kotlin Mumbai meetup recap covering an introductory Kotlin session by Filip Babić and a session by Akshay Chordiya on asynchronous programming with Kotlin Flows and coroutines. The online event was held on Google Meet and attracted 50-60 attendees.

### Source excerpt

Filip Babic and Akshay Chordiya take us through the world of kotlin!

## From RxJava to Kotlin Flow: Testing

DevFeed: [From RxJava to Kotlin Flow: Testing](<https://devfeed.tech/articles/from-rxjava-to-kotlin-flow-testing-38631.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_03_05_from_rxjava_to_kotlin_flow_testing/>)

Published: 2020-03-05T00:00:00Z

Content type: comparison

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [compare](<https://devfeed.tech/tags/compare.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

This article compares testing in RxJava and Kotlin Flow. It covers RxJava's TestObserver and TestScheduler, Kotlin Flow's TestCoroutineScope and TestCoroutineDispatcher, and examples of asserting stream values and completion.

### Source excerpt

Source This post is part of series of comparing RxJava to Kotlin Flow. Previous articles were about Threading, Backpressure, Error Handling, Stream Types, Throttling Introduction Testing is a crucial part of whole development. Testing allows you to write programs in a reliable fashion, prevent regressions and have many other goodies. I won't go through the list of advantages of writing tests in this article though. In testing it is important to have tools which allow you to write reliable tests and also tools which allow you to test your business logic. Business logic might be inside some function which calculates data and returns result, but also it might be some loading of data from network or doing some work in reaction to UI events. In places where we might have RxJava integrated. So it is very important to be able to test our rx-chains. In this article we'll go through the most important concepts in RxJava testing and compare it with what we have in Kotlin Flow.

## From RxJava to Kotlin Flow: Stream Types

DevFeed: [From RxJava to Kotlin Flow: Stream Types](<https://devfeed.tech/articles/from-rxjava-to-kotlin-flow-stream-types-38629.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_02_26_from_rxjava_to_kotlin_flow_stream_types/>)

Published: 2020-02-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [backpressure](<https://devfeed.tech/topics/backpressure.md>)

Tags: [backpressure](<https://devfeed.tech/tags/backpressure.md>), [flow](<https://devfeed.tech/tags/flow.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [reactive-programming](<https://devfeed.tech/tags/reactive-programming.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>)

### AI overview

This article compares stream types in RxJava and Kotlin Flow as part of a migration series. It explains RxJava's Observable, Flowable, Single, Maybe, and Completable, then maps them to Kotlin Flow or suspending functions and highlights differences in backpressure and stream composition.

### Source excerpt

Source This post is part of series of comparing RxJava to Kotlin Flow. Previous articles were about Threading, Backpressure, Error Handling Introduction In reactive programming we use streams. Therefore in both RxJava and Kotlin Flow we'll have to use some streams. Though we'll encounter some differences if we decide to migrate. In this article we'll try to get into the stream types which have RxJava and Kotlin Flow and some important differences.

## From RxJava to Kotlin Flow: Error Handling

DevFeed: [From RxJava to Kotlin Flow: Error Handling](<https://devfeed.tech/articles/from-rxjava-to-kotlin-flow-error-handling-38628.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_02_24_from_rxjava_to_kotlin_flow_error_handling/>)

Published: 2020-02-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [kotlin-flow](<https://devfeed.tech/topics/kotlin-flow.md>), [RxJava](<https://devfeed.tech/topics/rxjava.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [coroutine](<https://devfeed.tech/tags/coroutine.md>), [crashes](<https://devfeed.tech/tags/crashes.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exception](<https://devfeed.tech/tags/exception.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-flow](<https://devfeed.tech/tags/kotlin-flow.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [rxjava](<https://devfeed.tech/tags/rxjava.md>)

### AI overview

This tutorial compares error handling in RxJava and Kotlin Flow. It explains that RxJava propagates stream errors as terminal events to an Observer's onError callback, while Kotlin Flow uses coroutine exception handling, including try-catch and propagation to parent jobs or coroutine scopes.

### Source excerpt

Source This post is part of series of comparing RxJava to Kotlin Flow. Previous articles were about Threading and Backpressure. Introduction Error handling is fundamental in reactive programming. Reactive streams might fail with exception and propagate it as an event downstream notifying consumers on the error that happened. As in previous articles, we'll try to compare RxJava and Kotlin Flow error handling mechanisms. This might help us to migrate existing code from RxJava to Kotlin Flow and also understand how to properly use Kotlin Flow.

[Next page](<https://devfeed.tech/topics/kotlin-flow.md?cursor=WyIyMDIwLTAyLTI0VDAwOjAwOjAwKzAwOjAwIiwgImU5OWYwMjM1LWU3YzctNDI4MS04NjkxLTgzOTYzZWFhZjAxMSJd>)