I wanted to make my app look more professional, so I decided that I wanted to make a splash screen.
How would I create it and then implement it?
I wanted to make my app look more professional, so I decided that I wanted to make a splash screen.
How would I create it and then implement it?
Further reading:
Old answer:
HOW TO: Simple splash screen
This answers shows you how to display a splash screen for a fixed amount of time when your app starts for e.g. branding reasons. E.g. you might choose to show the splash screen for 3 seconds. However if you want to show the spash screen for a variable amount of time (e.g. app startup time) you should check out Abdullah's answer https://stackoverflow.com/a/15832037/401025. However be aware that app startup might be very fast on new devices so the user will just see a flash which is bad UX.
First you need to define the spash screen in your
layout.xml
fileAnd your activity:
Thats all ;)
Its really simple in android we just use handler concept to implement the splash screen
In your SplashScreenActivity java file paste this code.
In your SplashScreenActivity xml file put any picture using imageview.
Really easy & gr8 approach :
First create your splash with the following website :
https://www.norio.be/android-feature-graphic-generator/
Choose your logo and slogan, choose your beautiful background. resize it to 4096x4096.
Now download that picture and uplodate it to :
https://apetools.webprofusion.com/app/#/tools/imagegorilla
And generate all the splash screens needed, all devices, all platforms.
Enjoy!
There are enough answers here that will help with the implementation. this post was meant to help others with the first step of creating the splash screen!
Splash screen example :
Splash screens should not be loaded from a layout file, there might still be some lag when loading it.
The best way is to create a Theme just for your SplashScreenActivity and set
the android:windowBackground
to a drawable ressource.https://www.bignerdranch.com/blog/splash-screens-the-right-way/
In a nutshell:
Declare your SplashScreenActivity in the manifest:
In your SplashScreenActivity.java:
Next create the ressource for the background window of your theme:
Drawable file splash.xml: