← ClaudeAtlas

android-app-startup-bootstraplisted

App startup and bootstrap patterns for Android - App Startup library Initializer<T> with dependency ordering, lazy vs eager initialization strategy, Baseline Profiles with Macrobenchmark and profileinstaller, SplashScreen API with animated icons, Application class best practices, and a cold-start checklist to eliminate strict-mode violations and synchronous I/O from the main thread. Use this skill whenever optimizing app startup time, setting up the splash screen, configuring the App Startup library, generating Baseline Profiles, or deciding what belongs in Application.onCreate(). Trigger on phrases like "app startup", "cold start", "splash screen", "SplashScreen API", "Baseline Profile", "App Startup library", "Initializer", or "startup time".
lenorebreakneck630/claude-zero-to-hero-android-KMP · ★ 1 · AI & Automation · score 64
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(