This is a more theoretical question. Please let me know if I go in the wrong direction.
Is there any way to load some graph dependencies asynchronously / in parallel in dagger 2? Should one even consider it in the context of a dagger?
My problem is mainly related to the launch time of the application. Many external dependencies, such as Mixpanel, Crashlytics / Fabric, Retrofit (RestAdapter), cause the application to warm up for longer than 1 second.
What helped me a lot was the Lazy <> interface, but the final effect still did not satisfy me.
Any ideas?
Example
The application has SplashActivity, which depends on the SplashActivityPresenter, which depends on: the Mixpanel, RestAdapter, and Crashlytics libraries (and several "smaller" objects). Each of them has a .init () method, which takes a lot of time (Mixpanel initialization takes about 200 ms on Nexus 5, Android M. Therefore, it will take about 2 seconds as a result before the user sees the Splash screen.
Is there a way to build these objects in parallel?
android asynchronous dagger-2
froger_mcs
source share