Android Mobile Tutorials

Android Splash Screen Tutorial – Android Studio 2015

Written by Jana Raj

In this Android Splash Screen Tutorial, we see how to create how to create android splash screen using Android Studio 1.5.

A splash screen is a graphical control element consisting of window containing an image, a logo and the current version of the software. A splash screen usually appears while a game or program is launching.

Many apps like Facebook, twitter, Skype uses splash screen to splash their branding to the user. Now let see how to create such Splash screen using Android Studio.

android splash screen tutorial

Download Source code

Splash.xml

This is the layout for  your splash screen

Note : 

  • Linear Layout – To align your splash screen in a single direction
  • Width and Height – match_parent to fully cover the visible space of the screen
  • Orientation – Your choice
  • Background – Its your Logo

SplashActivity.java

The below code creates a thread and runs it for the specified time. It makes the splash screen i.e Splash.xml will be displayed for some time.

Note : 

  • sleep(3000) defines the time of the splash screen 3000 = 3 Seconds [Official Doc –  sleep(long time) ]
  • start() – to start the thread.

MainActivity.java

Create a onCreate method in MainActivity.java and setContentView to the activity_main.xml file.

 

AndroidManifest.xml

You should change the SplashActivity as a Launcher Activity to launch it first and then the MainActivity should be defined in the Manifest file.

 

About the author

Jana Raj

Janarthanan is the founder and Chief Editor of Tech4bros .He is a Student of Computer Science and Engineering ,a full time Geek, part time Blogger and Quarter time Coder. He loves Blogging, Web Designing and making new friends . Google Plus