I'm a Junior Android developer who has been working on an app for the past nine months. During this time, I have had many doubts about how to properly manage initialization tasks, such as:
- Reading initial preferences from DataStore
- Checking if the user has completed onboarding to decide the starting screen.
- Validating the authroization token (redirecting to the SignIn Screen if expired, or to Home if valid)
All these tasks have one thing in common: they need to run when the user opens the app for the first time, when the app comes back to the, or when it gets repened.
For this reason, I would love to hear your perspective on how you structure and handle this process in production apps, as well as any resources you recomended to help me gain seniority in Android development.
Currently, I've thought about using MainViewModel that only collects StateFlows (without holding domain logic). For navigation, I'm using a Channel injected by Koin with a sealed interface to emit events, which are received inside a LaunchedEffect to execute backstack navigation using Navigation 3.
What are your thoughts on this approach? How do you handle startup routing in your projects?
submitted by /u/Nioth23[link] [comments]