Android StateFlow vs LiveData Example | NotesApp StateFlow | CheezyCode (Hindi) @CheezyCode
Android StateFlow vs LiveData Example | NotesApp StateFlow | CheezyCode (Hindi)  @CheezyCode
Uploaded September 2022 | Updated September 2026, 1 week ago
Android Tutorial For Beginners - Learn how to convert LiveData to StateFlow using Kotlin. We have simply converted our LiveData code to use Kotlin State Flow. We have replaced MutableLiveData with MutableStateFlow and LiveData with StateFlow. We could have exposed simple Flow object but for simplicity we exposed StateFlow object.

StateFlow is identical to LiveData but there are subtle differences with respect to Threading, Lifecycles. Kotlin Flows are dependent on Coroutine Scope. Lifecycle of Flow is driven by the Coroutine Scope. Whenever scope is destroyed, flow is also destroyed.

For consuming or collecting flow objects inside Fragments and Activities we have this extension function - repeatOnLifeCycle. This methods helps to prevent resource wastage and memory leaks. You can read more about this function here -

medium.com/androiddevelopers/a-safer-way-to-collect-flows-from-android-uis-23080b1f8bda

Learn step by step - how to create a fully functional android app with simple example in Hindi.

Complete Dependency Injection Playlist Link -
youtube.com/playlist?list=PLRKyZvuMYSIPwjYw1bt_7u7nEwe6vATQd

Complete Android Architecture Components Playlist -
youtube.com/playlist?list=PLRKyZvuMYSIO0jLgj8g6sADnD0IBaWaw2

Beginner series in Android Playlist (Hindi) -
youtube.com/playlist?list=PLRKyZvuMYSIN9sVZTfDm4CTdTAzDQyLJU

Kotlin Beginners Tutorial Series -
youtube.com/playlist?list=PLRKyZvuMYSIMW3-rSOGCkPlO1z_IYJy3G

For more info - visit the below link
cheezycode.com

Source Code -
github.com/CheezyCode/YetAnotherNotesApp


We are social. Follow us at -
Facebook - facebook.com/cheezycode
Twitter - twitter.com/cheezycode
Instagram - instagram.com/cheezycode
Android StateFlow vs LiveData Example | NotesApp StateFlow | CheezyCode (Hindi)Android Jetpack Compose Lists | Lazy Columns | Recycler View Alternative| CheezyCode HindiDagger 2 @Named Annotation & Qualifiers Tutorial - CheezyCode (Hindi) #6JavaScript Interview Question - this keyword | CheezyCode #shortsAndroid Jetpack Compose State Concept - Hoisting & Unidirectional Flow | CheezyCode HindiJavaScript DOM Manipulation Hindi | Add/Remove HTML Elements CheezyCode | #36JavaScript Interview Question - Hoisting Concept | CheezyCode #shortsExpress JS Tutorial - Middleware for Authentication| API Security | CheezyCodeAndroid Tutorial | Navigation Framework with BackStack | CheezyCode (Hindi)
Cheezy Code |

Android StateFlow vs LiveData Example | NotesApp StateFlow | CheezyCode (Hindi)

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER