Home Android Tutorial How to Add Splash Screen in android App

How to Add Splash Screen in android App

0
How to Add Splash Screen in android App
Add Splash Screen in android App

Splash Screen is most commonly the first startup screen that appears when App is opened. In other words, it is a simple constant screen for a fixed amount of time that is used to display the company logo, name, advertising content etc.

A splash screen is a screen that appears when you open an app on your mobile device. So, we can say it’s the first impression for the user. It’s usually used to show the logo of the app or an image related to the app.

In my personal opinion, this is the simplest way to implement a static splash screen.

So, let’s code it.

  1. Create a new project in Eclipse by navigating to File ⇒ New Android ⇒ Application Project and fill required details. (I kept my main activity name as MainActivity.java)
  2. For Splash Screen we are creating a separate activity. Create a new class in your package and name it as SplashScreen.java
  3. Open your your AndroidManifest.xml file and make your splash screen activity as Launcher activity.

Notice that we do not have setContentView() for this SplashActivity. The view is displayed from the theme and this way it is faster than creating a layout.
If you look at the time splash screen displays is the same as the time taken by the app to configure itself because of a cold launch (very first launch). If the app is cached, the splash screen will go away almost immediately.


Hope using this article you will be able to make your splash screen work in the right way.