Towards Dev

A publication for sharing projects, ideas, codes, and new theories.

Follow publication

Member-only story

Say Goodbye to Fragments: How Jetpack Compose Redefines Modern Android Development (With Examples)

Gaurav Kumar
Towards Dev
Published in
5 min readDec 16, 2024

1. What Fragments Were Used For

2. How Jetpack Compose Replaces Fragment Functionality

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in Towards Dev

A publication for sharing projects, ideas, codes, and new theories.

Written by Gaurav Kumar

Gaurav Kumar is a Senior Technical Lead with 12+ years in Android dev, specializing in Kotlin, MVVM, and team leadership. Passionate about mobile innovation.

Responses (3)

Write a response

It's impossible to only use one view model for the entire app. And sometimes navigation is triggered after a business logic execution. As for example you do an API call in the view model and it fails, you need an error screen. The UI should not be responsible for the navigation logic in that case.

--

Thanks for the article. It is really hopeful to fully get rid of Fragments after all these painful years. However, some questions still remain:
1) If there is no any fragment in an app, this mean we cannot have Fragment-Scoped-Viewmodels, which are…

--

are you able to implement multiple backstack navigation same way as in Instagram or YouTube without any issues? How do you pass complex dataclass as the navigation route parameters seem to accept only primitive types or strings?

--