Android Splash Screen the way Google recommend it

Bhushan Jichkar
4 min readFeb 18, 2020

--

Introduction

Splash Screen, also know as Launch Screen by Google is one of the major important aspect of mobile app design. In today’s Android and iOS market this Launch Screen is the very first screen that greet users.

The Solo purpose of Splash/Launch screen for Business is to Show the App or Company or Product Logo as Branding.

Hence most of the app have splash screen so that product branding can be done along with app setup in the background. And by app setup I mean, which screen will open next once Launch screen is finished, loading of database or any api calls and all sort stuff the development team wants to do.

Splash Screen in Action

Audience

This article is for android guys and any other aspirant mobile and web app developer who wants to explore how thing works at big giants.

So lets begin with the step by step process of Splash Screen Design and Use it in project.

The current project code you see in this article is in Kotlin, you will find that below in Git hub link.

Step 1 : Create Project

Please check out below Images to create an empty project.

On Activity Chooser Section click on empty activity.

Create project

Once the project is created and synced it will show you default activity MainActivity.kt and default xml file activity_main.xml.

For Splash screen we only need empty activity without layout file, hence move ahead and create new Activity with name SplashActivity and uncheck Generate Layout File checkbox.
Tip : For Splash Activity, we do not need any layout for the SplashActivity, we are going to manage the UI from style and drawable itself.

Create Splash Activity

By default, we will only get onCreate() Method, but considering the fact that along with just displaying logo, we as a developer also need to do some parallel operation in background such as screen/ activity to open next, its better to put our code in onResume() method. Hence create onResume() method.

Splash Activity code

MoveToNextSection() will take care of our what to do next when splash screen loading done. In my case I am simply opening MainActivity.
Tip : Using Shared preferences you can easily manage which screen to open such as login , welcome slider or main menu.

Step 2 Creating a splash screen

For this you will need to
A) Create Drawable file with splash_background in drawable directory.

Drawable file for Splash Screen

B) Few images to show on splash screen.

Add all the images such as app logo, background image and overlay to drawable directory.

C) Create Style for Splash screen

Add SplashTheme in style

Step 3 Attaching splash activity with splash_background in AndroidManifest.

Here we are adding Theme : SplashTheme to our SplashActivity.
Thus it will help us to combine theme with activity, so that when activity run it will show the theme associated with it, thus creating launch screen without any actual layout.

Manifest code

Now just run the program and you will see the Splash Screen.

Your Splash Screen

Comparison of New way vs old way of app design

Splash Screen : the new way

  • No need of handler, app will by-default show Splash Screen/ Launcher Screen till all the setup is done for smoothly running the app.
  • Easier to maintain on different devices as no layout present.
  • Faster app execution and display of Splash screen.

Splash Screen : Old Handler Way

  • Use handlers to freeze app for few seconds to show user splash screen thus causing all the app initialization process to stop.
  • Additional overhead might occur as for different screen size, developer will need to create different layout.
  • Feels like cold start in app.

Here is the Github Link :

Bonus Things about Splash Screen :

1. Splash Screen design above way have few benefits

- It will automatically setup app for running smoothly such as initialize memory for the app, string pool, stack memory etc. Thus once all this done, app will automatically call onResume() method, thus your app setup will be done completely and you will experience smooth flow.

2. When you open the app first time, it will take some milliseconds to load app in memory but later on once app resides in memory the later on app opening will be much faster, the same you can checkout in YouTube app. At first you will see splash screen for long duration rather as compare to opening app in second time.

Hope you enjoyed this article, don’t forget to clap!!!

--

--

Bhushan Jichkar

Mobile Enthusiast | Entrepreneur | Developer | Big Data Tech Enthusiast | Google : Associate Android Developer