How to create splash screen in android studio – full tutorial

0 3,108

Create splash screen in android studio

In this tutorial, I will describe the steps to Create Splash Screen in Android Studio. A Splash Screen is a Graphical control element having the window containing an image, logo and the present version of the software. It typically appears when a game or program is launching.

Android Splash screens are mostly used to show the user some sort of progress before the App loads fully. Few people use splash screen just to display their App/Company logo for some seconds. Unlike IOS, in Android, we don’t have any built-in mechanism to display the splash screen.

Application using Splash Screen

There are many popular Android Apps such as Skype, Facebook, Adobe Reader etc uses Splash Screen for displaying their logo.

Now let’s see how we can implement Splash screen in Android Application.

Steps to Follow

  • Create a new Project in Android Studio and name it as “AddSplashScreen”.
  • Select the minimum API level.
  • Select Blank Activity and click Next.
  • Name your Blank Activity as MainActivity and click Finish.
  • For Splash Screen create a separate Activity. Create a new Activity in your package and name it as SplashScreen.java.
  • Write the following code in SplashScreen.java.

  • Go to layout activity_splashscreen.xml under the res>layout folder. Write the following code in activity_splashscreen.xml.

  • Right Click on res folder, select New and then click Directory, a popup dialog box appears. Enter the name of the directory in it as anim and press ok.
  • Again right click on res folder, select New and then click Android resource file. In it enter the Directory name as anim and File name as alpha_anim. Within the same directory create another file and name it as translate_anim.
  • Write the following code inside alpha_anim.

  • Write the following code inside translate_anim.

  • In order to make your splash screen to work, you need to refer the SplashScreen Activity as a main in Android Manifest. So open the Manifest file by clicking on AppManifestsAndroidManifest.xml. change the following code in it.

Now you can run and test your application.

Download Source code

Comments

comments

Leave A Reply

Your email address will not be published.