Questions tagged [kodein]

For questions regarding the libraries of the Kodein Framework (a Kotlin/Multiplatform architecture component framework). Questions should specify which library is being asked about (DI, DB, Log, etc.) as well as the source-set in which the problem occurs (Android, Native, Common, etc.).

The Kodein Framework

The Kodein Framework provides several libraries that can be used independently or together. Each provides an opinionated architecture component to ease and accelerate Kotlin/Multiplatform applications.

Links:

Tag usage

When posting questions about Kodein libraries, please make sure to include:

  • The source-set where the issue arises (common, intermediate, platform).
  • The target system & compiler (Android, JVM, JS, Native).
  • Kotlin version.
89 questions
0
votes
1 answer

Kodein and activity context discuss

I have researched this example repo to understand how to implement Kodein in the Android app. But I was confused about the context questions in the activity case in the example. Here the code: abstract class BaseActivity
Serg Burlaka
  • 2,351
  • 24
  • 35
0
votes
1 answer

How to insert and inject a arraylist into any service or activity class using kodein dependency injection?

Recently I have started to learn kodein dependency injection here I'm trying to load data into ArrayList and then inject that ArrayList into desired service or activity however I'm unable to do this and facing run time crashes any guidance will be…
R.Coder
  • 257
  • 3
  • 17
0
votes
0 answers

HTTP method annotation is required Retrofit2

I have an abstraction of usage of repository pattern and I'm not able to do a retrofit call. I'll go from Retrofit service to my use case. I've AuthenticationRetrofitService interface AuthenticationRetrofitService { @GET(LOGIN_PATH) …
StuartDTO
  • 783
  • 7
  • 26
  • 72
0
votes
1 answer

How to use Kodein with Conductor in Android?

I want to use both Conductor and Kodein in my application. The problem is that both the application context and the activity are null on the Controller setup and I can't access Kodein instance. class SetupNavigationController: Controller(),…
Foad Saeidi Nik
  • 260
  • 1
  • 5
  • 20
0
votes
2 answers

How to pass multiple parameter for Kodein Injected instances?

In Kodein, I have the below binding bind() with multiton { title: String -> AppDependent(title, instance(), instance()) } I could get it created using private val appDependent: AppDependent by instance(arg = "My…
Elye
  • 53,639
  • 54
  • 212
  • 474
0
votes
2 answers

required: KodeinBinding

In exploring Kodein, I'm following the example in https://proandroiddev.com/dependency-injection-with-kotlin-kodein-koin-3d783745e48d val diModel = Kodein.Module { bind() with singleton { FakeTasksRepository() } } I…
Elye
  • 53,639
  • 54
  • 212
  • 474
0
votes
0 answers

WorkManager and Kodein

I'm having troubles implementing android WorkManager with Kodein. I want to use the WorkManager to track background location updates and send post requests to my server periodically with the users new location. I've seen multiple ways to implement…
mikle
  • 21
  • 3
0
votes
1 answer

Can I Inject activity's viewmodel and use It inside Dialog Fragment

I am trying to Inject activity's view model and I want use it inside Dialog Fragment, how to inject it with Kodein? and use the view model which I've inject before in other activity or fragments. I've try tutorial from medium here is the…
Hyper Space
  • 11
  • 1
  • 3
0
votes
1 answer

How to instance many parameters for Factory class with Kodein

I'm using Kodein as injecting dependency for my kotlin project. So I have a factory of my ViewModel like below class ReadViewModelFactory(private val readRepository: ReadRepositoryImpl, private val activity: ReadActivity) :…
Nanda Z
  • 1,604
  • 4
  • 15
  • 37
0
votes
2 answers

Kotlin, Coroutines, Kodein and list for RecyclerView

I just started learning of Kotlin Android and I decided to use in my first Kotlin app Coroutines and Kodein library. My problem is returning list of the objects created in the Room Database. I know how to set simple list for Recyclerview, but I have…
beginner992
  • 659
  • 1
  • 9
  • 28
0
votes
0 answers

What would be the proper way for dependency injection of App Executor class using Kodein in android coroutines Network Bound Resouce class?

I am looking for the right way to inject dependency of App Executors class using Kodein in Repository in Android MVVM pattern. I am following this guy https://www.baruckis.com/android/kriptofolio-app-series-part-5/ For the rest of app I have used…
faizan
  • 1
  • 3
0
votes
1 answer

How to fix Kodein Force close error in Android

WHY NOT HELP ME ANY PEOPLE??? In my application i used Kotin and Kodein for Dependency injection. I write below codes, but when run application show me Force close error! In my application i used Kotin and Kodein for Dependency injection. I write…
Jake warton
  • 2,163
  • 4
  • 11
  • 20
0
votes
2 answers

How can I use Kodein's direct retrieval to fetch a dependency bound as a factory?

Consider the following injector: class Injector constructor(secretSauce: SecretSauce) { val kodein = Kodein { bind() with factory { beans: List, herbs: List -> SpicyBeans(secretSauce, beans, herbs) …
BenLanc
  • 2,344
  • 1
  • 19
  • 24
0
votes
1 answer

Simple Kotlin Project does not show any UI

I have a very simple Android Project in Kotlin. Just to dig in Kodein. I can not see the two TextViews in the main_layout? I have used MVP pattern for the only MainActivity I have there.. The app starts without a crash and is show a blank white…
Tranquillo
  • 235
  • 2
  • 13
0
votes
1 answer

Kodein-DI Gradle dependency in common module

I'd like to define a Kodein-DI module in common Kotlin code (so I could import it from both JS and JVM modules). What Gradle dependency should I add to commonMain?
snorbi
  • 2,590
  • 26
  • 36