Android Splash Screen Tutorial

Android splash screen is used so that apps can show their brand icons before showing the content of app. This may also used to do some background work in  your application like loading resources from network while the splash screen is being shown. This will look smooth for user.

Unfortunately in android we don’t have any inbuilt mechanism to show splash screen compared to iOS. In this tutorial we are going to learn how to implement splash screen in your android application.

When to use splash screen :
  1. To show your brand logo user.
  2. To load data from network or other source while showing splash screen.

We will be covering first scenario in this tutorial. One is showing splash screen using a timer.

 

 

Preview :

Logic :

There is nothing magical in this case. We will create two activities , say MainActivity and SplashActivity. Now we will make SplashActivity as "android.intent.category.LAUNCHER" so that its icon is visible on launcher. When user will click application icon on launcher then the SplashActivity will be called and it will show some UI and after that it will launch the MainActivity .

So let’s get started by creating a new project

 Android Splash Screen Using Timer

1. Create a new project in Eclipse by navigating to File ⇒ New Android ⇒ Application Project and fill required details.

2. For Splash Screen we are creating a separate activity. Create a new class in your package and name it as SplashActivity.java

3. Now open AndroidManifest.xml update to following :

4. Create file activity_splash.xml in res => layout and copy following code.

5.  Now add following code to SplashActivity.java

6.  Now build and run the project. You will see splash screen for 3 second and then the main activity.

guru

Technology enthusiast. Loves to tinker with things. Always trying to create something wonderful using technology. Loves coding for Android, Raspberry pi, Arduino , Opencv and much more.

You may also like...

  • Didik Sazali

    How to make 2 pictures as splash screen?

    • Hello didik
      Just create 2 splash activities and then show first splash screen. Finish it and then show one and after that show normal app screen.
      Hope you understood. please comment for any other queries

    • AndroidSRC .

      Hello didik
      Just create 2 splash activities and then show first splash screen. Finish it and then show one and after that show normal app screen.
      Hope you understood. please comment for any other queries

  • Lore

    Hi, my splash screen is not full screen. How i do to make a full screen? Thank you

    • To make splash activity full screen please use Fullscreen theme.

      android:theme=”@android:style/Theme.NoTitleBar.Fullscreen”

      • Lore

        I use this theme on AndroidManifest.xml?

  • Joe

    Hi, I followed your steps and the a screen works. however, on my device, i see my app twice. One of them shows the splash screen and the other doesn’t. Thanks in advance

  • Joe

    Hi, I have solved my problem because I have duplicated activities. However, whenever I open the app, it shows the splash screen then says:”Unfortunately [your app] has stopped.” Please help. Thanks again

  • Yugandhar Vadlamudi

    use full for the beginners

    • Very Glad to help. You can request custom tutorials by mailing us.

  • Pingback: Video in Android App Splash Screen - AndroidSRC()