How To Create Modern Splash Screen For Android Application

An Nguyen
4 min readDec 12, 2020

--

I. What Is Splash Screen ?

Splash screen is a special screen which your app will display as soon as it’s started. As usually, it contains your slogan, app version or maybe a simple logo. This screen lifetime is pretty short, it just last for about 2 or 3 seconds. For example when you open YouTube app you will see it’s logo for only 1.5 second.

Youtube App Splash Screen

II. What its uses ?

Yes of course ! It will make your app become more friendly and professional. 👏👏👏

But as a developer you have to consider about 2 meanings below:

  • Erase Blink Time”- When your app is about to start, it need a short time to initial it’s resources and this time depends on your app’s data as well as device’s hardware. Your splash screen will handle this issue and users can’t feel like there is a “gap” between starting time and intial time, UX will be improved. ✔
  • Do It Behind”- It means that your app can do some background tasks before going to the first screen such as API call, get data from local storage ,... ✔

III. Splash Screen Is Easy Why I have To Read This ?

Well, you can create a splash screen so easily without any problem but did you do it in the right track ? Two examples about splash screen below will show you the difference.

Example 1 (Normal splash screen):

Example 2 (Mordern splash screen):

Uber App Splash Scren

After seeing those examples you can recognize that the second one provides better method as well as user experience and suitable delay time.

Now lets start coding ; )

IV. Implementation

  1. Create Resource Files For Splash Screen

In order to increase display time we will are not going to create layout just like other activities.

First of all, we define a color value for our custom layout :

Go to values -> color.xml and add color to the file.

Add Custom Color Value

2. Create Our Custom Theme

We edit our style.xml file at “res/values/styles.xml” as below

3. Create Activity For Splash Screen

Now we need an activity to “link” to created theme above so we will do this in this step.

Go to your package which MainActivity is contained then right click on it → New → Activity → Empty Activity.

Create An Empty Activity

Now you will see a popop appears, remember to uncheck “Generate a Layout FIle” option because we already defined our own layout for this activity but we will check on “Launcher Activity” to set it to be the first called activity when your app is started.

Configure Activity

Now we will make our app jump to Main Activity after Splash Screen is finished its job by calling Intent

We almost done here, but wait we need the last important step it is link your created theme to splash activity.

4. Link Theme To Splash Activity.

Go to under mainifest folder you will see an AndroidManifest.xml file, edit it

Add your theme attribute “android:theme=”@style/SplashscreenTheme"” to Splash Screen activity tag, and your AndroidManifest.xml file kinda look like this

Note: If you see more than one <intent-filter> tags which is not wrapped inside your splash screen activity tag just delete it because there is only one launcher in one app.

You can download my source code HERE. 🎁

Thank you for reading, good luck and have a nice day 👌

--

--

An Nguyen
An Nguyen

Written by An Nguyen

0 Followers

After earning my software engineering bachelor degree in Vietnam from FPT University, I dived into coding world with passion and excited spirit ❤

No responses yet