Background
I have to use Roboguice for an app, which handles a lot of injections on many classes.
The app also has a splash screen class which extends from RoboSplashActivity .
The problem
As the app got more and more complex, more time was spent on the splash screen activity, and it even shows its content layout after a while , meaning the user sees a blank screen about 1-2 seconds before there is even a splash image.
What I've tried
At the beginning I thought it was because the splash image was too have (since it had multiple layers of images) so I tried setting a simple color. Turns out it's not the reason.
Then I thought that it might be that the app takes a lot of space, so I created a totally new project with the same size, and it worked fine. so a large app isn't the reason for slow start up.
Then I thought that it's the RoboSplashActivity's fault, so I've replaced it with a new activity (extending Activity instead ) that only shows a solid color background. the background showed after a while , almost the same time as using RoboSplashActivity . Still not the reason for the blank screen.
Now what I think is that it's Roboguice's fault, and that I should somehow delay its initialization to the time that something is shown on the screen, so that at least the user will see something while it's loading.
The question
Is it possible to optimize Roboguice to have the minimal start time ?
Maybe delay its initialization that is done on other files ?