Any good examples of manual dependency injection?

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

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.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • On

    Kotlin Dependency Injection with zero setup and zero boilerplate code

  • Here's a lib I made to use in my Android projects, it's so hard for me to ever use anything else because of how simple it is

  • compose-samples

    Official Jetpack Compose samples.

  • 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
  • persista

    Small kotlin library for persisting _single instances_ of kotlin data classes

  • I use manual DI whenever I don't want to force Koin or Dagger on a project, or I want to keep things super simple. This method gives you either single instance or factory, no lazy initialization, and no scoping (you'd have to add the ViewModel scoped stuff) simple app that has it: https://github.com/erdo/persista/tree/main/example-app/src/main/java/foo/bar/example (dependencies constructed here): https://github.com/erdo/persista/blob/main/example-app/src/main/java/foo/bar/example/OG.kt (getting the dependencies into your UI here): https://github.com/erdo/persista/blob/main/example-app/src/main/java/foo/bar/example/ui/wallet/WalletsActivity.kt ``` private val wallet: Wallet = OG[Wallet::class.java] ``` another larger app example: https://github.com/erdo/apollo3-android-sample It looks quite like a ServiceLocator but the difference is these things are not statically referenced and can easily be mocked in tests

  • apollo3-android-sample

    sample android apollo3 client app

  • I use manual DI whenever I don't want to force Koin or Dagger on a project, or I want to keep things super simple. This method gives you either single instance or factory, no lazy initialization, and no scoping (you'd have to add the ViewModel scoped stuff) simple app that has it: https://github.com/erdo/persista/tree/main/example-app/src/main/java/foo/bar/example (dependencies constructed here): https://github.com/erdo/persista/blob/main/example-app/src/main/java/foo/bar/example/OG.kt (getting the dependencies into your UI here): https://github.com/erdo/persista/blob/main/example-app/src/main/java/foo/bar/example/ui/wallet/WalletsActivity.kt ``` private val wallet: Wallet = OG[Wallet::class.java] ``` another larger app example: https://github.com/erdo/apollo3-android-sample It looks quite like a ServiceLocator but the difference is these things are not statically referenced and can easily be mocked in tests

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

  • Performance Impact Analysis of Gradle 8.7 in Android Projects

    1 project | dev.to | 23 Mar 2024
  • Jetpack Compose Mastery Part 2: Advanced Tools and Resources for Mastering Compose UI

    2 projects | dev.to | 28 Jan 2024
  • Need suggestions for a good expense manager

    1 project | /r/androidapps | 9 Dec 2023
  • ⟳ 0 apps added, 12 updated at apt.izzysoft.de

    1 project | /r/FDroidUpdates | 5 Dec 2023
  • Feeder Play Store vs F-Droid Version?

    1 project | /r/androidapps | 20 Nov 2023