Building a Splash Screen with Animation in Android
A splash screen is the short visual sequence shown while an Android application loads its first screen. It can display a brand mark, a background colour, or a small animation that gives users immediate feedback. When designed carefully, it makes the transition into an app feel deliberate rather than delayed.
Modern Android development uses the SplashScreen API, which provides a consistent launch experience on Android 12 and later. The AndroidX compatibility library also supports older devices, making it a practical choice for applications targeting a broad audience, including budget phones still common in the Australian market.
A useful splash screen should be brief, lightweight, and connected to the application’s visual identity. It should not become an advertisement or force users to wait through a long animation. People checking transport information in Sydney, opening a banking app in Melbourne, or using an app during a commute generally expect the main interface to appear quickly.
The example below uses Kotlin and Android Studio. It combines the AndroidX SplashScreen library with a short animation on the first activity, while keeping heavier work away from the launch path. This approach also works well when testing across different network conditions, including slower mobile connections outside major Australian cities.
| Approach | Best use | Advantages | Limitations |
|---|---|---|---|
| AndroidX SplashScreen API | Standard application launch | Compatible, consistent, easy to maintain | Limited animation control during system launch |
| Animated first activity | Branded post-launch transition | Flexible logo and content animation | Can feel slow if overused |
| Custom launch activity | Special startup workflows | Full control over timing and logic | More code and greater risk of delays |
Preparing the Android project
Open the project-level application module in Android Studio and add the AndroidX SplashScreen dependency. In a Gradle Kotlin script, the dependency can be declared as follows:
dependencies {
implementation("androidx.core:core-splashscreen:1.0.1")
}
Use the latest stable version available for your project rather than copying an old version without checking. Set the minimum SDK according to your audience and device data. Android 12 introduced the platform splash screen, while AndroidX helps present a similar experience on older releases.
The app should use a launch theme that defines the background and starting icon. Keep the launch theme simple because Android displays it before the activity is fully created. A large image, remote font, or complex drawable can increase startup time, particularly on entry-level devices used on prepaid plans in regional areas.
Defining the launch theme
Create or update a theme in res/values/themes.xml. The exact parent may vary depending on the Android Studio template, but the important attributes are the splash background and animated icon:
<style name="Theme.SampleApp.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/brand_blue</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_app_logo</item>
<item name="postSplashScreenTheme">@style/Theme.SampleApp</item>
</style>
Add the starting theme to the application in AndroidManifest.xml:
<application
android:theme="@style/Theme.SampleApp"
android:label="@string/app_name">
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.SampleApp.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The splash icon should be a simple vector drawable or adaptive icon with clear edges. Avoid placing detailed text inside it because the displayed size varies across Android versions. Colours should meet accessibility expectations and remain visible in both bright outdoor conditions and dark mode.
Installing the splash screen in Kotlin
Call installSplashScreen() before super.onCreate() in the launcher activity. This gives AndroidX an opportunity to apply the compatibility behaviour before the activity renders its layout:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val splashScreen = installSplashScreen()
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
If the activity extends ComponentActivity, AppCompatActivity, or another compatible class, the same placement generally applies. Import the function from AndroidX:
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
Avoid starting database migrations, network requests, or preference loading directly in a way that blocks the first frame. For an app using SQLite or SharedPreferences, load only the information needed to display the first screen, then perform secondary work after the interface is visible.
Adding a controlled animation
The system launch animation is intentionally limited. To create a branded effect, animate a view in the first activity after the splash screen has disappeared. For example, an ImageView can fade and scale into place:
val logo = findViewById<ImageView>(R.id.logoView)
logo.alpha = 0f
logo.scaleX = 0.85f
logo.scaleY = 0.85f
logo.animate()
.alpha(1f)
.scaleX(1f)
.scaleY(1f)
.setDuration(350L)
.start()
A duration of roughly 250 to 500 milliseconds is usually enough. Longer sequences can frustrate users who open an app frequently, such as a weather or timetable application. The animation should support the interface rather than delay it, and it should be skipped or reduced when the user has enabled a reduced-motion preference.
For a more complex effect, use Android animation resources or Jetpack Compose animation APIs. Keep motion predictable: fade, scale, and a small translation are generally easier to understand than rotating logos or rapidly changing colours. Test the result on both high-refresh-rate phones and older devices.
Keeping startup work efficient
A splash screen cannot fix slow application architecture. Measure startup time with Android Studio’s profiler and inspect what happens before the first contentful frame. Move remote requests, expensive image decoding, and large database queries out of onCreate() whenever possible.
A useful pattern is to show the home layout immediately, then display a loading state for content that is still arriving. This is especially important for users travelling through areas with variable coverage on Telstra, Optus, or Vodafone networks. An app that presents a usable shell before synchronisation feels faster than one that holds the splash screen until every request completes.
If startup data is essential, use a splash screen condition sparingly:
val splashScreen = installSplashScreen()
splashScreen.setKeepOnScreenCondition {
viewModel.isLoading.value
}
The condition must become false quickly and reliably. It should not depend on an API call with no timeout. A failed request should allow the main screen to appear with an error state, retry control, or cached content.
Designing for accessibility and Australian users
Use sufficient contrast between the logo and background, provide a meaningful app label, and ensure the first screen supports screen readers. Splash content usually has little interaction, so avoid adding buttons or tiny status messages that users cannot operate comfortably.
Australian users may open applications in bright sunlight, while commuting on Sydney trains, waiting for a tram in Melbourne, or using a phone outdoors in Brisbane. Test colours and icon clarity under high brightness. Also consider offline behaviour for people in regional towns or remote areas, where a launch sequence that waits for cloud services can become especially frustrating.
Privacy should guide startup decisions as well. Under Australia’s Privacy Act 1988, covered organisations must handle personal information appropriately. Do not collect analytics, location, contacts, or advertising identifiers merely to display a splash screen. If the app processes personal information, explain that use through a suitable privacy notice and manage consent where required.
Testing the animated launch experience
Run the application on Android 12 or later, then test an older Android version using an emulator or physical device. Check cold starts, warm starts, rotation, dark mode, font scaling, and the system’s “remove animations” accessibility setting. Confirm that the icon does not appear cropped or stretched.
Test with a slow connection and with no connection at all. A splash screen should still lead to the app’s cached or offline interface when possible. This matters for applications used on long drives between Australian cities, in underground stations, or in locations where network coverage changes quickly.
Also verify that pressing the Back button, opening the app from a notification, and returning from another activity do not replay an unnecessary startup animation. The launch animation belongs to the initial entry experience, not every navigation event.
Avoiding common splash screen problems
The most common mistake is using the splash screen as a loading screen for an unpredictable amount of time. Users should not stare at a logo while the application downloads configuration, checks every account setting, or waits for a remote server. Display the main interface and communicate progress within the relevant screen instead.
Another problem is visual inconsistency between the launch theme and the first activity. Match the background colour, icon style, and typography so the transition appears continuous. Remove placeholder content before release, and make sure the application name is correctly localised for the markets in which it is distributed.
A short, accessible animation paired with efficient startup code creates a polished result. The AndroidX SplashScreen API handles platform differences, while a lightweight activity animation gives the brand a small amount of personality without compromising speed or usability.