
Design inspiration: Dribbble.
Picture a theme park’s flashy entrance. That’s what a splash screen is for your app. It’s the cool intro with your app’s logo, version, and a loading indicator. They make your app look awesome while keeping the same function. It’s like your app’s superhero cape.
Splash Screen: Why Bother?
Google tells us that if your app takes more than 3 seconds to load, 53% of users will bail out. So, here’s where the splash screen struts in, saving the day.
Splash Screen: Stylin’ Tips
Creating a splash screen is like dressing up for a fancy party. What’s on the checklist?
- Mind screen details and keep it simple.
- Share progress if you must.
- One splash is plenty.
- No ads and no unnecessary 5–7 second delay.
Splash screens in Android? You bet! Let’s dive into two ways to get them in your app.
Delay using Timers (Not the Coolest)
Imagine waiting in line for your favourite rollercoaster, but having to wait extra just because. That’s what happens with this method.
We create a SplashActivity, throw in a timer delay, and move on to the main event.
Pros:
- You decide how long the splash screen lasts. Show off that cool animation you made!
Cons:
- There’s a weird white screen before your splash screen pops up. Blame it on the cold start.
Cold Start: This is the time period from the moment the code is initialized until the user interface is ready to use.
[Implementation]
public class SplashActivity extends AppCompatActivity {
private static int DELAY = 3000; // 3 seconds
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// Start your app main activity
Intent i = new Intent(
SplashScreenActivity.this,
MainActivity.class
);
startActivity(i);
// Close this activity
finish();
}
}, DELAY);
}
}