One Expensive Android Mistake: Initializing Ads Too Late
Ad SDK setup at the wrong lifecycle point leads to revenue loss and intermittent crashes. The app may “work,” but fill rate and startup stability both suffer.
Step 1: Initialize once in Application scope
class App : Application() {
override fun onCreate() {
super.onCreate()
MobileAds.initialize(this)
}
}
Step 2: Gate ad requests on init readiness
if (adsReady.get()) {
adLoader.load()
}
Step 3: Capture startup and ad metrics together
data class AdStartupMetrics(
val coldStartMs: Long,
val firstAdRequestMs: Long,
val firstFillMs: Long?
)
Pitfalls
- Initializing SDK inside Activity
onCreate. - Sending ad requests before SDK readiness.
- No metrics linking startup path to fill performance.
Validation
- Crash-free startup remains stable across devices.
- Median first-fill latency improves after init fix.
- Initialization is idempotent and runs once per process.