Overview
Splash Ads are advertisements displayed on the splash screen when the app launches. The ad is shown alongside your app’s logo, providing a natural user experience.
Features
Natural ad exposure at app launch
Maintains brand image with app logo
360dp × 270dp ad area, 288dp × 288dp logo area
Image ad support
Android 12+ system splash screen support
Use the test unit ID during development: PUBLIC_TEST_UNIT_ID_SPLASH
Ad and Logo Sizes
Splash ads use predefined areas:
Logo area : 288dp × 288dp (center of screen)
Ad area : 360dp × 270dp (bottom of screen)
The ad is displayed at the bottom of the screen, with the app logo positioned at the top
Implementation Methods
Splash ads can be implemented in two ways depending on your app’s requirements:
Using AdropSplashAd - Integrates with system splash screen (Android 12+)
Using AdropSplashAdView - Custom splash screen configuration
Method 1: Using AdropSplashAd (System Splash Integration)
This method integrates with the system splash screen on Android 12 (API 31) and above. AdropSplashAdActivity automatically manages the splash screen.
Add the following settings to app/src/main/res/values/strings.xml.
< resources >
<!-- App name -->
< string name = "app_name" > My App </ string >
<!-- Splash ad unit ID -->
< string name = "adrop_splash_ad_unit_id" translatable = "false" > YOUR_SPLASH_UNIT_ID </ string >
<!-- Activity to navigate to after splash ends -->
< string name = "adrop_splash_ad_next_activity" translatable = "false" > com.yourcompany.yourapp.MainActivity </ string >
</ resources >
Use PUBLIC_TEST_UNIT_ID_SPLASH instead of YOUR_SPLASH_UNIT_ID for testing.
Step 2: Add Splash Logo Image
Add your app logo to the res/drawable/ folder.
app/src/main/res/drawable/splash_logo.png
Recommended size: 288dp × 288dp (@2x: 576px, @3x: 864px)
Set AdropSplashAdActivity as the launcher activity.
< manifest xmlns:android = "http://schemas.android.com/apk/res/android" >
< application
android:name = ".MyApplication"
android:theme = "@style/Theme.App" >
<!-- Splash Ad Activity -->
< activity
android:name = "io.adrop.ads.splash.AdropSplashAdActivity"
android:theme = "@style/Theme.App.Splash"
android:exported = "true" >
< intent-filter >
< action android:name = "android.intent.action.MAIN" />
< category android:name = "android.intent.category.LAUNCHER" />
</ intent-filter >
</ activity >
<!-- Main Activity (navigates here after splash ends) -->
< activity
android:name = ".MainActivity"
android:exported = "false" />
</ application >
</ manifest >
android:exported="true" is required for AdropSplashAdActivity.
Add the splash theme to res/values/themes.xml.
< resources >
<!-- App default theme -->
< style name = "Theme.App" parent = "Theme.Material3.DayNight.NoActionBar" >
<!-- App theme settings -->
</ style >
<!-- Splash theme (Android 12+) -->
< style name = "Theme.App.Splash" parent = "Theme.SplashScreen" >
< item name = "windowSplashScreenBackground" > @color/white </ item >
< item name = "windowSplashScreenAnimatedIcon" > @drawable/splash_logo </ item >
< item name = "postSplashScreenTheme" > @style/Theme.App </ item >
</ style >
</ resources >
On devices below Android 12, the system splash is not displayed and AdropSplashAdActivity is shown directly.
Step 5: Customize Layout (Optional)
If you want to use a custom layout instead of the default, create activity_adrop_splash_ad.xml in your app’s res/layout/ folder.
res/layout/activity_adrop_splash_ad.xml
<? xml version = "1.0" encoding = "utf-8" ?>
< RelativeLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "#ffffff"
android:paddingHorizontal = "24dp"
android:fitsSystemWindows = "true" >
<!-- App logo (center) -->
< ImageView
android:src = "@drawable/splash_logo"
android:layout_width = "288dp"
android:layout_height = "288dp"
android:scaleType = "fitXY"
android:layout_centerInParent = "true" />
<!-- Ad area (bottom) - Required -->
< ImageView
android:id = "@+id/adrop_splash_ad_image"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_centerHorizontal = "true"
android:layout_alignParentBottom = "true" />
</ RelativeLayout >
An ImageView with android:id="@+id/adrop_splash_ad_image" is required. The ad will be displayed in this view.
Step 6: Initialize SDK in Application
import android.app.Application
import io.adrop.ads.Adrop
class MyApplication : Application () {
override fun onCreate () {
super . onCreate ()
// Initialize SDK
Adrop. initialize ( this , production = false )
}
}
Step 7: Implement AdropSplashAd Listener (Optional)
To receive splash ad events, set up a listener in your Application class.
import android.app.Application
import io.adrop.ads.Adrop
import io.adrop.ads.splash.AdropSplashAd
import io.adrop.ads.splash.AdropSplashAdListener
import io.adrop.ads.model.AdropErrorCode
class MyApplication : Application () {
private lateinit var splashAd: AdropSplashAd
override fun onCreate () {
super . onCreate ()
// Initialize SDK
Adrop. initialize ( this , production = false )
// Configure splash ad
splashAd = AdropSplashAd ( this ) { splashAd ->
// shouldSkip: Determines whether to skip splash ad
// Return true to skip the ad and go directly to the main screen
checkShouldSkipSplash ()
}
splashAd.splashAdListener = object : AdropSplashAdListener {
override fun onAdReceived (ad: AdropSplashAd ) {
println ( "Splash ad received successfully" )
}
override fun onAdFailedToReceive (ad: AdropSplashAd , errorCode: AdropErrorCode ) {
println ( "Failed to receive splash ad: $errorCode " )
}
override fun onAdImpression (ad: AdropSplashAd ) {
println ( "Splash ad impression" )
}
override fun onAdClose (ad: AdropSplashAd , impressed: Boolean ) {
println ( "Splash ad closed - impressed: $impressed " )
}
}
}
private fun checkShouldSkipSplash (): Boolean {
// Example: Skip splash when entering via deep link or under certain conditions
// Such as when the app is launched via push notification
return false
}
}
AdropSplashAd Properties
Property Type Description unitIdStringAd unit ID (read-only) creativeIdStringAd creative ID (read-only) isClosedBooleanWhether splash ad is closed (read-only)
AdropSplashAd Methods
Method Description close()Immediately closes splash ad and navigates to next screen
shouldSkip Callback
Use the shouldSkip callback in the AdropSplashAd constructor to skip splash ads under certain conditions.
val splashAd = AdropSplashAd (application) { splashAd ->
// Skip splash when app is launched via push notification
val isPushNotification = intent?.extras?. containsKey ( "push_notification" ) == true
// Skip splash when entering via deep link
val hasDeepLink = intent?. data != null
isPushNotification || hasDeepLink
}
When shouldSkip returns true, the ad is not loaded and navigates immediately to the next screen.
To change the default display duration (2 seconds), create res/values/integers.xml file and configure it.
< resources >
<!-- Ad request timeout (milliseconds, 500~3000) -->
< integer name = "adrop_splash_ad_request_timeout" > 1000 </ integer >
<!-- Ad display duration (milliseconds, 500~3000) -->
< integer name = "adrop_splash_ad_max_timeout" > 2000 </ integer >
</ resources >
The configurable range is 500ms to 3000ms. Values outside this range are automatically corrected.
Skip Splash on Push Notification Deep Link (Optional)
You can configure to skip splash ads when the app is launched via push notification with a deep link.
< resources >
<!-- Skip splash on push notification deep link -->
< bool name = "adrop_splash_ad_skip_push_notification_clicked" > true </ bool >
</ resources >
Method 2: Using AdropSplashAdView (Custom Splash)
Use this when you want to configure a custom splash screen yourself. Create your own splash Activity and place AdropSplashAdView.
Step 1: Create Layout
<? xml version = "1.0" encoding = "utf-8" ?>
< RelativeLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "#ffffff"
android:padding = "24dp" >
<!-- App logo -->
< ImageView
android:id = "@+id/logo"
android:layout_width = "288dp"
android:layout_height = "288dp"
android:layout_centerInParent = "true"
android:src = "@drawable/splash_logo"
android:scaleType = "fitXY" />
<!-- Splash ad view -->
< io.adrop.ads.splash.AdropSplashAdView
android:id = "@+id/splash_ad_view"
android:layout_width = "match_parent"
android:layout_height = "270dp"
android:layout_alignParentBottom = "true" />
</ RelativeLayout >
Step 2: Implement SplashActivity
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import io.adrop.ads.splash.AdropSplashAdView
import io.adrop.ads.splash.AdropSplashAdViewListener
import io.adrop.ads.model.AdropErrorCode
class SplashActivity : AppCompatActivity () {
private lateinit var splashAdView: AdropSplashAdView
override fun onCreate (savedInstanceState: Bundle ?) {
super . onCreate (savedInstanceState)
setContentView (R.layout.activity_splash)
// Initialize splash ad view
splashAdView = AdropSplashAdView (
context = this ,
unitId = "YOUR_SPLASH_UNIT_ID" ,
adRequestTimeout = 1000L // Ad request timeout (milliseconds)
)
// Set listener
splashAdView.listener = object : AdropSplashAdViewListener {
override fun onAdReceived (ad: AdropSplashAdView ) {
println ( "Splash ad received successfully" )
}
override fun onAdFailedToReceive (ad: AdropSplashAdView , errorCode: AdropErrorCode ) {
println ( "Failed to receive splash ad: $errorCode " )
}
override fun onAdImpression (ad: AdropSplashAdView ) {
println ( "Splash ad impression" )
}
override fun onAdClose (ad: AdropSplashAdView , impressed: Boolean ) {
println ( "Splash ad closed - impressed: $impressed " )
goToMainActivity ()
}
}
// Load and display ad
findViewById < ViewGroup >(android.R.id.content). addView (splashAdView)
splashAdView. load ()
}
private fun goToMainActivity () {
startActivity ( Intent ( this , MainActivity:: class .java))
finish ()
}
}
< manifest xmlns:android = "http://schemas.android.com/apk/res/android" >
< application >
<!-- Custom Splash Activity -->
< activity
android:name = ".SplashActivity"
android:theme = "@style/Theme.App.Splash"
android:exported = "true" >
< intent-filter >
< action android:name = "android.intent.action.MAIN" />
< category android:name = "android.intent.category.LAUNCHER" />
</ intent-filter >
</ activity >
<!-- Main Activity -->
< activity
android:name = ".MainActivity"
android:exported = "false" />
</ application >
</ manifest >
AdropSplashAdView Properties
Property Type Description unitIdStringAd unit ID (read-only) creativeIdStringAd creative ID (read-only) isClosedBooleanWhether splash ad is closed (read-only) txIdStringTransaction ID (read-only) campaignIdStringCampaign ID (read-only)
AdropSplashAdView Methods
Method Description load()Loads and displays the ad
Listeners
AdropSplashAdListener
Listener for when using AdropSplashAd.
Method Required Description onAdReceived(ad)Optional Called when ad is received successfully onAdFailedToReceive(ad, errorCode)Optional Called when ad fails to load onAdImpression(ad)Optional Called when ad impression is recorded onAdClose(ad, impressed)Optional Called when splash ad closes
AdropSplashAdViewListener
Listener for when using AdropSplashAdView.
Method Required Description onAdReceived(ad)Optional Called when ad is received successfully onAdFailedToReceive(ad, errorCode)Optional Called when ad fails to load onAdImpression(ad)Optional Called when ad impression is recorded onAdClose(ad, impressed)Required Called when splash ad closes. Must handle main screen transition
When using AdropSplashAdView, you must implement the onAdClose method to handle the transition to the main screen.
impressed Parameter
The impressed parameter in onAdClose(ad, impressed) indicates whether the ad was actually displayed.
override fun onAdClose (ad: AdropSplashAdView , impressed: Boolean ) {
if (impressed) {
println ( "Ad was displayed to user" )
// Post-impression logic
} else {
println ( "Ad was not displayed (load failure or skip)" )
// Non-impression handling logic
}
// Navigate to main screen
goToMainActivity ()
}
Cases When impressed is false
Ad load failure
Network error
User skipped before viewing ad
Insufficient ad inventory
Best Practices
1. Set Appropriate Timers
Splash ads should not be displayed too short or too long.
<!-- Recommended settings -->
< integer name = "adrop_splash_ad_request_timeout" > 1000 </ integer > <!-- 1 second -->
< integer name = "adrop_splash_ad_max_timeout" > 2000 </ integer > <!-- 2 seconds -->
2. Optimize Logo Image
Prepare your app logo in appropriate sizes to minimize loading time.
drawable-mdpi/splash_logo.png (192px × 192px)
drawable-hdpi/splash_logo.png (288px × 288px)
drawable-xhdpi/splash_logo.png (384px × 384px)
drawable-xxhdpi/splash_logo.png (576px × 576px)
drawable-xxxhdpi/splash_logo.png (768px × 768px)
3. Handle Failures
Ensure the app starts normally even when ad loading fails.
override fun onAdFailedToReceive (ad: AdropSplashAdView , errorCode: AdropErrorCode ) {
println ( "Ad load failed: $errorCode " )
// Navigate to main screen even on failure
goToMainActivity ()
}
4. Distinguish Test Environment
Distinguish between development and production environments for testing.
val splashUnitId = if (BuildConfig.DEBUG) {
"PUBLIC_TEST_UNIT_ID_SPLASH"
} else {
"YOUR_PRODUCTION_SPLASH_UNIT_ID"
}
// Initialize SDK
Adrop. initialize (application, production = ! BuildConfig.DEBUG)
5. Prevent Memory Leaks
Clean up listeners when Activity is destroyed.
override fun onDestroy () {
splashAdView.listener = null
super . onDestroy ()
}
Testing
Test Unit ID
Use the test unit ID during development.
// Test unit ID
val testUnitId = "PUBLIC_TEST_UNIT_ID_SPLASH"
Be sure to use the actual unit ID created in the Adrop console for production deployment. Deploying with test unit IDs will not generate ad revenue.
Debugging
Check ad events with logs.
splashAdView.listener = object : AdropSplashAdViewListener {
override fun onAdReceived (ad: AdropSplashAdView ) {
Log. d ( "AdropSplash" , "Ad received successfully" )
Log. d ( "AdropSplash" , " - unitId: ${ ad.unitId } " )
Log. d ( "AdropSplash" , " - creativeId: ${ ad.creativeId } " )
}
override fun onAdFailedToReceive (ad: AdropSplashAdView , errorCode: AdropErrorCode ) {
Log. e ( "AdropSplash" , "Ad receive failed: $errorCode " )
Log. e ( "AdropSplash" , " - Check network status" )
Log. e ( "AdropSplash" , " - Verify unit ID: ${ ad.unitId } " )
}
override fun onAdImpression (ad: AdropSplashAdView ) {
Log. d ( "AdropSplash" , "Ad impression" )
Log. d ( "AdropSplash" , " - txId: ${ ad.txId } " )
Log. d ( "AdropSplash" , " - campaignId: ${ ad.campaignId } " )
}
override fun onAdClose (ad: AdropSplashAdView , impressed: Boolean ) {
Log. d ( "AdropSplash" , "Ad closed" )
Log. d ( "AdropSplash" , " - impressed: $impressed " )
Log. d ( "AdropSplash" , " - isClosed: ${ ad.isClosed } " )
}
}
Troubleshooting
Splash screen is not displayed
Verify that AdropSplashAdActivity or custom SplashActivity is set as LAUNCHER in AndroidManifest.xml
Check android:exported="true" setting
Verify SDK initialization is complete (Application class)
Check that adrop_service.json file is in the assets folder
Check network connection status
Verify the unit ID is correct (strings.xml or code)
Verify production = false setting in test environment
Check onAdFailedToReceive error code
Verify adrop_service.json file content is correct
Not transitioning to main screen
Verify adrop_splash_ad_next_activity setting is correct (full package path)
Check onAdClose implementation when using AdropSplashAdView
Verify Activity’s full qualified name (e.g., com.myapp.MainActivity)
Custom layout is not applied
Verify filename is exactly activity_adrop_splash_ad.xml
Check that an ImageView with android:id="@+id/adrop_splash_ad_image" ID exists
Clean build and re-run the app (Build > Clean Project > Rebuild Project)
System splash not visible on devices below Android 12
This is normal. The system splash screen is not supported on devices below Android 12, and AdropSplashAdActivity is displayed directly.
Next Steps