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...