r/androiddev • u/SK-RMs • 14d ago
AppState | Jetpack Compose (Android)
https://developer.android.com/topic/libraries/architecture/appstateLooks like we have got a new way to manage state alongside whatever we had till now. Don't get me wrong but I think adding more options for doing the same thing is (and has been) confusing and just supports the complexity even further. Thoughts?
75
Upvotes
18
u/Ok-Engineer6098 14d ago
I had enough of Google reinventing the wheel every few years and switched to Flutter for UI on new projects.
When you finally did UI the "correct new" way it would get deprecated.
7
u/drabred 14d ago
Am I the only one not being interested in it at all in 2026? :/ Especially in Claude era... yeah I thing I am good with my VMs and State
67
u/jc-from-sin 14d ago
It's another sign that the people working at jetpack libraries have never worked on a real app before.
23
u/Zhuinden 14d ago
I've seen
MutableState<T>break from being written to from a background thread, so now you need to care "oh it's being written to from a transform {} so now it's actually ok".Feels like
CoroutineLiveDatawhich never got popular for a reason, but even forgot lifecycle integration exists.I like how their design for the persistable app state (seamlessly to datastore in the background) has application state preserving process death (and any death, really) as part of the design principles; though on one hand it feels like you are writing to keys in a shared pref and exposing the flows as
State<T>and you wonder if it's really necessary. Seen worse, probably seen better.Personally I didn't mind combine, I use tuples for the most part (and now agents write the code anyway so who cares what I like, lol).
39
u/Fantastic-Guard-9471 14d ago
I just don't understand why they are wasting resources on such stuff and divide the community providing more options. We finally have battle-tested patterns more or less same for the whole community.
35
u/V2UgYXJlIG5vdCBJ Dev 14d ago
Aaaand it’s deprecated.
26
u/UnimplementedError 14d ago
Flutter state management:
12
u/mreeman 14d ago •
More compose through the stack is good IMO. It's basically first party molecule but targetting State instead of Flows.
12
u/mrdibby 14d ago
I understand the need.
There's so much ViewModel code that reads like
It can read much easier with
4
u/KangstaG 14d ago
It’s essentially a simpler StateFlow. I’m for reactive programming, but it does feel like this just adds another option unnecessarily.
Being a simpler reactive programming solution, I suppose it’s useful for novice Android developers or non-Android engineers, but that’s about it. For experienced Android engineers, it’s really important to understand and work with coroutines so I feel like it’s better to stick with StateFlows.
4
u/Radiokot1 13d ago
Did I understand correctly that this is the same as Molecule made by The Lord Jake Warthon?
https://github.com/cashapp/molecule
9
u/FunCoolOh 14d ago
It seems to me that it solves a problem that doesn't exist. We already have an observable state holder and that's StateFlow. This also couples domain code with the compose machinery and requires an extra compiler plugin, whereas StateFlow is lean and agnostic and compatible (sort of) with multiplatform. Not seeing myself ever using this unless it really solves a problem for me that StateFlow doesn't.
3
u/agherschon 14d ago
I like it, its a good step forward 👍
3
u/wightwulf1944 14d ago
I understand we don't need to use it if it does not solve any particular problem we're having that isn't already solved by our current tools but this being developed 1st party means employers will eventually want people to be familiar with it.
2
u/ursusino 14d ago
This is materially worse than using StateFlows. No point
5
u/epicstar 14d ago
It's a yikes and "wtf Google" for me dawg
1
u/kabonbonkabobon 11d ago
The changes seems to be for AI rather than humans. its basically a simplified version of everything like dagger to hilt.
1
u/LelouBil 10d ago
So basically this replaces the Flow/Stateflow and .mapLatest/collectLatest and so on in viewmodels ?
That's what I've been doing until now.
-3
u/Old-Frosting1988 14d ago
Faltu ka bakchodi kar rhe ho bsdk,
-4
u/Old-Frosting1988 14d ago
I think adding more options for doing the same thing is (and has been) confusing and just supports the complexity even further. Thoughts?
Baaki chizo ka clearance hai ? ki kya unka usage hai ?
agr haan to fir kaise smjh nai aa raha ki ae new handlers are for what ???
Bass bakchodi kara lo ,, httttt,