API call from ViewModel constructor or dedicated public method

This page summarizes the projects mentioned and recommended in the original post on /r/androiddev

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • android-showcase

    💎 Android application following best practices: Kotlin, Coroutines, JetPack, Clean Architecture, Feature Modules, Tests, MVVM, DI, Static Analysis...

  • In a typical app that fetches data from API (without using Flows), do you prefer to fetch data in a ViewModel constructor (init) or have a dedicated public method called from view (e.g. onViewCreated -> viewModel.onEnter). Here is example of the second approach from the Showcase app (see the onEnter method): https://github.com/igorwojda/android-showcase/blob/main/feature_album/src/main/kotlin/com/igorwojda/showcase/feature/album/presentation/screen/albumlist/AlbumListViewModel.kt

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts