Splash Screens the Right Way On Android

Vignesh Theagarajan
2 min readJan 18, 2019

--

As we all know the purpose of splash screen but only few application use proper way.Here we are going to see the proper way and common mistake that are widely used to implement splash screen.

Common Mistake

This method is widely used by most of the dev in there learning period. That is how to display a splash screen for a fixed amount of time when your app starts for the first time.

Its bad practices to make the user wait for the time every time. So never hard code the time for splash Screen.

Don’t follow this method.

yes by using the above code we purposefully wasted users 3 seconds. For the user it will be annoying.

If your app is too large like game or need data from sever before the app starts you may navigate to main screen after you got response from server.

Right way

Every app will need particular time to load for the first time or after its killed(cold launch). The splash screen will be displayed for that time duration only no longer than that. The time may vary from device to device based on the specification or depends on the number of process already running on the device.

Create a new activity or java class rename it SplashActivity.java and extend it to activity because you wont need a layout file.

Now we need to create an XML drawable splash_background.xml inside the res/drawable folder.

Now we need to create a theme or splash screen for that Navigate to your styles.xml file and add a new theme for your splash activity.

And the last step is to apply the theme you crated to your splash activity, by updating the AndroidManifest.xml file.

Wrapping up

We now created a proper splash screen. Now you can see the time difference for the splash screen from hard coded duration and this method.

That’s it for this time! Thanks for reading!

If you enjoyed this article, please click the 👏 button and share to help others find it! Feel free to leave a comment below.

--

--

Vignesh Theagarajan

android developer. Decently chubby guy. Wears glasses. Has a beard. Thinks he’s funny. Loves food a lot more than he should. http://vigneshtheagarajan.com/