android-app-startup-bootstraplisted
Install: claude install-skill lenorebreakneck630/claude-zero-to-hero-android-KMP
# Android App Startup and Bootstrap
## Core Principles
- Every millisecond of cold start is user-visible. Treat the main thread on startup as sacred.
- Do not initialize anything in `Application.onCreate()` that is not needed to render the first frame.
- Use the App Startup library to declare explicit initialization order and enable lazy loading.
- Baseline Profiles move critical code out of JIT and into AOT-compiled paths — generate them before every release.
- The SplashScreen API is the only supported way to show a launch screen on Android 12+.
---
## Application Class Best Practices
`Application.onCreate()` runs on the main thread before any UI. Keep it minimal.
Belongs in `Application.onCreate()`:
- registering the App Startup `AppInitializer` (if not using manifest-based discovery)
- crash reporting SDK init (but defer heavy config)
- creating the notification channels (see **android-notifications-push**)
- strict-mode setup in debug builds
Does not belong there:
- network calls
- database opens or migrations
- heavy SDK initialization that can be lazy
- anything that reads from disk synchronously
```kotlin
class App : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(
StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build()
)
StrictMode.setVmPolicy(