Nov 1, 2025 路 4 min read 路 The ViewModel is the bridge between Domain and the UI. The objective of the viewmodel is to allow the flow of data upwards to the UI. package com.learning.artsnapapp.presentation.viewmodel import androidx.lifecycle.ViewModel import androidx.lifecycl...
Join discussionApr 24, 2025 路 2 min read 路 Flow vs Stateflow vs Sharedflow First, the Base Type: Flow<T> A cold asynchronous stream. Starts emitting only when collected. Use for standard data streams (e.g., database queries, API paginated responses). fun getNumbers(): Flow<Int> = flow { ...
Join discussion
Mar 9, 2024 路 4 min read 路 Background Android development often involves complex state management and repetitive UI updates. ViewModels offer such structure and testability to address these challenge and many others. With LiveData, UI changes automatically synchronizes with Vi...
Join discussion
Jan 17, 2023 路 3 min read 路 Managing states in Android can be complex, especially when dealing with asynchronous and streaming data. In this article, we'll look at how we can remove this complexity using kotlin flows. Flows, What are they? In coroutines, a flow is a type that c...
Join discussion
Jun 24, 2022 路 5 min read 路 Hey Kotliners馃憢,In this blog, we are gonna do the experiment with the very 馃敟hot StateFlow as the title of this blog suggests, we have to build a utility which can help us combining multiple StateFlows into another transformed StateFlow. Before divin...
Join discussion
Jun 7, 2022 路 2 min read 路 If you are getting tired by reading all the stuff on the internet related state flow and shared flow and want to know what they actually are then in this blog I have shared some easy understanding of it and check out all the code snippets for better ...
Join discussion