Questions tagged [toothpick-di]

Toothpick is a scope tree based Dependency Injection (DI) library for Java with a special focus on Android. It performs as well as the daggers, but offers a simple approach to Di.

Toothpick Toothpick is a scope tree based Dependency Injection (DI) library for Java with a special focus on Android.

Toothpick (a.k.a TP) API is based on Guice/RoboGuice APIs, but it avoids runtime reflection by using annotation processing like Dagger 1 & Dagger 2 do. Hence, TP claims to be simpler to use, offer best testing support but have performances at least as good as the Daggers.

https://github.com/stephanenicolas/toothpick

User Snicolas is one of the authors.

22 questions
1
vote
1 answer

Toothpick NoFactoryFoundException

The app I'm working on is crashing in production and users are reporting the below stack trace. The problem is that I cannot reproduce it myself. Caused by: toothpick.registries.NoFactoryFoundException: at…
Jens Moser
  • 153
  • 7
1
vote
1 answer

Is there a way to re-add a Module to a Scope in a Toothpick DI library?

I have a use case which seems to indicate the need to have something like scope.removeModules(...) available in the Toothpick DI library. In an Android application I have a module which creates a binding to the class which talks to a server through…
dimsuz
  • 8,969
  • 8
  • 54
  • 88
0
votes
1 answer

Injecting generics with Toothpick DI

I've been playing around with ToothPick DI and I'm on a situation where I need to inject a couple of generics to a presenter and I don't know how to do it, or if it's even possible. Here's an example of what I'm trying to do. This is an example of…
Tofasio
  • 425
  • 3
  • 14
0
votes
1 answer

Not able to find ToothPickRule class in 3.0.2 version

I updated the toothpick sdk version to 3.0.2 from 1.1.3. After updating, not able to find ToothPickRule class under testing package in toothpick. Which is causing test cases to fail.
bimal chawla
  • 447
  • 1
  • 7
  • 21
0
votes
1 answer

Can we inject "View" in Presenter using Toothpick as in Dagger?

In Dagger, You can inject your activity as View in Presenter, Please follow below example, Splash Module @Module class SplashModule { @Provides fun provideXUseCase( xRepository: XRepository ) = XUseCase(xRepository) …
AndiGeeky
  • 11,266
  • 6
  • 50
  • 66
0
votes
1 answer

Toothpick doesn't inject dependencies in injected instance

I created Activity, ViewModel, Modules for Toothpick and Authenticator. @Singleton public class GetSmsViewModel { @Inject Application app; @Inject Authenticator authenticator; ... } public class GetSmsActivity extends AppCompatActivity…
Kirill
  • 55
  • 7
0
votes
1 answer

Injecting memebers on Instrumented test with toothpick

I've got an instrumented Android test using Toothpick DI: @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { private static final String LOG_TAG = ExampleInstrumentedTest.class.getName(); @Inject Context mContext; …
Diederik
  • 5,536
  • 3
  • 44
  • 60
1
2