Create a Splash Screen with Video in Android

person shubham sharmafolder_openAndroidlocal_offer, access_time September 20, 2017

Splash Screen

In this quick tutorial we will see how to implement a Video Splash Screen in your app. Splash Screens are normally shown for a few seconds as a progress while the app is ‘booting up’  i.e performing a version check or initialising the Analytics etc. Sometimes the Splash Screen is also used to showcase the app branding or logo.

Most of the Splash Screen consists of static logo or branding image but we can also show a short ‘branding video’ in Splash Screen too which is not more than a couple of  seconds.

Add the Video to raw Directory

Add the short splash.mp4 video to the raw Directory.  raw Directory should be created inside the res Directory if it is not present.

Changes in AndroidManifest.xml

 

Create the SplashScreen Activity and make it the Launcher Activity in the AndroidManifest.xml. Also lock the screen orientation to ‘portrait’.

SplashScreen Activity

Now lets create the SplashScreen Activity which will launch on the app startup and play the Splash Screen Video. Here we are using a modified VideoView called MutedVideoView which is discussed in the upcoming sections. Its optional and you may even use the Normal VideoView.

 

Layout activity_splash.xml

Add the following code in your layout

 

MutedVideoView

Add the following class to your activity. You may use the normal VideoView too instead.

 

Please let me know your Suggestions / Queries in comments.

warningComments are closed.