How to Implement Android Splash Screen - Android Hire
Android Phones

How to Implement Android Splash Screen

Aditya Singh
This tutorial will teach you how to implement an android splash screen. We can see Android splash screens in every app, also known as the launch screen. When the app opens, it loads the screen, and some processes happen in the background.

Android Splash Screen Using Timer

1. Open android studio, go to File ⇒ New Project and fill in all the details.

2. To make a Splash Screen you have to make a new activity. Name that activity Splash_Screen.java (you can make it according to your wish). The XML file will be created automatically if you click blank new activity.

" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button">
xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.androidhire.splashscreen">
    <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">        
        <activity android:name=".Splash_Screen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            intent-filter>
        activity>        
        <activity android:name=".MainActivity" />
    application>
manifest>

3. Go to res ⇒ layout then click on splash screen XML file. In this, you will show the logo or text you want to show on a splash screen. If you want to save any images then you have to put an image in res ⇒ drawable.

" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button">
xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_splash">
    <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true" android:minHeight="0dp" android:minWidth="0dp" android:src="@drawable/logo_splash" />
RelativeLayout>

4. Add code to SplashScreen.java activity. In this, you have to specify the time you want to wait on that screen and after that on which activity you want to go.

package com.androidhire.splashscreen;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

public class Splash_Screen extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash__screen);
    new Handler()
      .postDelayed(
        new Runnable() {
          @Override
          public void run() {
            Intent i = new Intent(Splash_Screen.this, MainActivity.class);
            startActivity(i);
            finish();
          }
        },
        2000
      );
  }
}

5. I have added the background gradient, for that, you have to go res ⇒  drawable then make a file and make it bg_splash.xml. In place of a gradient, you can put some logo or normal text to show on the splash screen.

" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button">
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <gradient android:angle="90" android:endColor="#9b2a58" android:startColor="#290505"> gradient>
shape>

In the drawable folder only you have to add the logo. Run the application on the emulator or on your device and check the application.

Go through the code to understand better how splash screens work. If you are unable to understand or want some features comment below.

Aditya Singh's profile picture

Aditya Singh

With over seven years of experience, I help people understand technology through clear and insightful articles. I cover the latest in technology, mobile devices, PCs, how-tos, guides, news, and gadget reviews, always staying updated to provide accurate and reliable information.

Related Posts

7 Top Samsung Galaxy Ring Alternatives for 2025

7 Top Samsung Galaxy Ring Alternatives for 2025

Tired of waiting for the Samsung Galaxy Ring to hit the market? You’re not alone. The smart ring market already has many impressive alternatives available now, despite the buzz around Samsung’s upcoming smart ring. These devices pack advanced health tracking and contactless payment features that might surpass Samsung’s planned offerings. The current lineup of smart […]

What Is Quiet Mode on Instagram and How to Activate It

What Is Quiet Mode on Instagram and How to Activate It

Ever wondered what Quiet Mode on Instagram is all about? This simple yet powerful Instagram feature helps you take a break from the constant buzz of notifications and focus on what truly matters. Whether you’re striving for better work-life balance, dedicating time to studying, or simply trying to disconnect from social media distractions, Quiet Mode […]

How to Make a Bed in Minecraft (Step-by-Step Guide)

How to Make a Bed in Minecraft (Step-by-Step Guide)

A bed in Minecraft is very important. It lets you skip the night and set your spawn point, so if you die, you will return to your bed instead of the original world spawn. This guide will show you how to gather materials, craft a bed, and set your spawn point. We’ll also show you how to customize your bed, build bunk […]

10 Best MMORPG Games For Android

10 Best MMORPG Games For Android

Not too long ago, MMORPG games and powerful gaming consoles were mostly exclusive to PCs. They required high-end graphics and systems to deliver their immersive gameplay. But times have changed. With the rise of gaming-oriented smartphones, you can now enjoy PC-like gaming experiences on your Android device. Thanks to these technological advancements and faster internet […]

Roblox: Fruit Battlegrounds codes (January 2025)

Roblox: Fruit Battlegrounds codes (January 2025)

Fruit Battlegrounds codes are all about getting more gems and help you to shoot up your rank in this One Piece anime-inspired game. This Fruit Battlegrounds was made by Popo developer. It is an action-packed game where players battle it out using unique fruit-based abilities. With constant updates, new fruits, and exciting challenges, it’s a fruity frenzy you won’t […]

Roblox: Ultimate Football Codes (January 2025)

Roblox: Ultimate Football Codes (January 2025)

Want to get some extra items for Ultimate Football in Roblox? You’ve come to the right place! Here’s the latest list of codes to help you score touchdowns and look stylish on the field. These codes offer free rewards such as coins and cosmetics to enhance your gameplay. What are Ultimate Football Codes? Ultimate Football […]

Roblox: Da Hood Codes (January 2025)

Roblox: Da Hood Codes (January 2025)

Are you a fan of Roblox games, in this article we will look at the Roblox Da Hood Codes for December 2024 that will help you unlock exclusive items, improve your gameplay and dominate the streets of Da Hood. You can feel that the game is inspired by the Grand Theft Auto series and there […]