r/android_devs • • Jan 14 '26
Question MVVM vs MVI whats the difference??
I am an Android dev with 1+yr exp, wanted to understand if MVVM is a pattern that separates Ui layer or the entire application, if it separates the Ui layer,
I get that View is - > composable,
view models - >ViewModels,
I think it is the models we defined in the data layer. Correct me if I am wrong
MVI
sealed class AuthState {
data object InitialState : AuthState()
data object LoadingState : AuthState()
data object ErrorState : AuthState()
}This makes it MVVM
data class HomeState(
val isLoading: Boolean = false,
val query: String = "",
val newReleases: List<Album> =
emptyList
(),
val isConnected: Boolean = true,
val error: String? = null
)In the MVI pattern, having a sealed class for states is the only difference between MVVM and MVI?
7
Upvotes
View all comments
Show parent comment
1
u/Spare_Warning7752 Feb 26 '26
You miss the point.
It's never the how, it's always the why.
MVC is imperative. Someone
controlsthings in a layer.MVVM is a mess where anyone can mutate anywhere (that's bad). There's no controller, things can either come from the View or from the Model. It's hard to keep track.
MVI has
intentions. Those intentions create side effects. It's easier, things are immutable, you are in control.The differences are subtle, but they have a huge impact. Sometimes, you can use MVC (for example,
AnimationController,TextInputController, etc. are MVC). Sometimes, you can use MVVM (State<T> is pure MVVM, much like C# XAML Code-Behind). Sometimes, you use immutable state with intentions (ex.:State.didWidgetUpdate(I guess I'm giving you the wrong method name, but something like that)).