Creating an Android Splash Screen

Let’s now make our PDF Splitter a bit more professional by easily adding a cool splash screen.

Creating an Android Splash Screen

The splash screen is the activity displayed to the user when they launch the application for the first time. Splash screens typically show a logo and can be thought of as welcome screens.

The starting point of this exercise, which is quite self-explanatory, is the PlugPDFSplitter project implemented in this post.

We just have to add to the project the following files:

  • java\com\mycompany\plugpdfsplitter\
  • res\layout\splash.xml
  • res\drawable\splash.png

Figure 1. Project structure

Figure 1. Project structure file

This is the Java code where the magic happens. The splash layout is displayed for two seconds thanks to Android’s Handler class.

splash.xml file

splash.png file

This is the image to be displayed when the app is run.

epapyrus logo

Figure 2. The image to be displayed

Figure 3. Splash screen

Figure 3. Splash screen

AndroidManifest.xml file

Finally, the Android manifest must be updated as illustrated below.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *