Android SplashScreen

Android Splash screen is a UI that is displayed in any android application just before the main UI is displayed. There are different purposes for which we use this screen. In general, we use it for the following purposes.

  • To show the logo of the app: We show the brand / logo etc. of the application using the splash screen. For this purpose, we use timer. 
  • We need to use the application to obtain / fetch basic data from the server: You can use the splash screen to send data to the server and/or download resources (image, files, videos, etc) from the server to be used in the application. 

For example: Download and store data in the database, download required images, parse Json/xml file, send device information and register the device to the server.

  • To show something even before your application is started, i.e. the main activity layout is inflated by the system: As recommended by Google, this should be the actual purpose of the splash screen. It actually takes some time to inflate the main activity layout, especially in Cold Launch, whenever we start android application.


You will see white(blank) screen in this duration. Finally, display the splash screen until the main layout of your application is inflated. We can use the logo of our application as a splash screen.

Now-a-days, for any reason (mentioned above) people use android splash screen. So, we're going to use android splash screen.

Hey, Developers ! In this tutorial we will see how to use Android SplashScreen in any android application.

Unfortunately, compared to IOS, there is no built-in mechanism for implementing android splash screen in android apps. So, using activity, we will implement splash screen.

Let's start the tutorial with the creation of new project and the implementation of basic materials. After that, we will start implementing splash screen.

At first, we will create android application. Then, we will see how to build SplashScreen in the application.

Follow steps below to create new project. Please ignore the steps if you have already created a new application.

S. No. Steps
1 Open Android Studio.
2 Click on Start a new Android Studio Project then choose your project and select Empty Activity.
3 Write application name as SplashScreen after this write a package name you can write your own package name.
4 Select language Java. Select minimum SDK you need. However, we have selected 17 as minimum SDK. Then, click next button.
5 If you have followed above process correctly, you will get a newly created project successfully. However, you can also visit tutorial  to Create a New Project to know steps in detail.

Create an activity_splash.xml file in res=>layout folder. And include the following code.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android=""


Create an file in com.ukacademe.splashscreen. And include the following code.

package com.ukacademe.splashscreen;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.WindowManager;

public class SplashScreenActivity extends AppCompatActivity {

    // Splash screen timer
    private static int TIME_OUT = 3000;

    protected void onCreate(Bundle savedInstanceState) {

        new Handler().postDelayed(new Runnable() {

             * Showing splash screen with a timer. This will be useful when you
             * want to show case your app logo / company

            public void run() {
                // This method will be executed once the timer is over
                // Start your app main activity
                Intent i = new Intent(SplashScreenActivity.this, MainActivity.class);

                // Close this activity
        }, TIME_OUT);

Now in styles.xml file we added windowActionBar ="false" & windowNoTitle = "true" to hide the ActionBar and and windowTitle to show the splashscreen in full display.

Note :  Its only for splash screen we don't want ActionBar and Title in SplashScreen but we need this both in our main activity or in other activity for that we need to add one more theme for our other activities. So include the following code into your styles.xml file.


<!-- Base application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>

<style name="AppThemes" parent=&quot Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>


Now, the last step is in AndroidManifest.xml file here we can define our file and MainActivity. So include the following code into your AndroidManifest.xml file.


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""


<activity android:name=".SplashScreenActivity">
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<activity android:name=".MainActivity"


Congratulations! your SplashScreen App is completed just run it on your device or in emulator.