shekhar23/claude-zero-to-hero-android-kmp/android-app-startup-bootstrap
Claude Code and agent skill by shekhar23/claude-zero-to-hero-android-kmp
- community
Checking that the SKILL.md file is still in the repository.
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".
Install
npx vskill@latest install shekhar23/claude-zero-to-hero-android-kmp/android-app-startup-bootstrapSKILL.md
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
Anti-pattern: calling FirebaseApp.initializeApp(this) manually when google-services.json is present — the plugin already generates an automatic ContentProvider that runs before Application.onCreate().
App Startup Library
Dependency
Initializer<T>
Each Initializer<T> does one thing and declares its dependencies:
Manifest registration (eager — runs on app start)
Lazy initialization
Omit a component from the manifest and initialize it on first use:
This is ideal for SDKs needed only in specific features (e.g., a map SDK used only on the map screen).
Disabling an auto-start initializer from a library
If a third-party library ships its own Initializer and you want to control timing:
SplashScreen API (Android 12+)
The SplashScreen API is mandatory on Android 12+. The old windowBackground theme trick still works as a fallback for older versions.
Dependency
Theme setup
MainActivity — install the splash screen
Call installSplashScreen() before setContent, and before super.onCreate() is not required but must precede any content inflation:
Anti-pattern: blocking onCreate() with runBlocking while waiting for data. Use setKeepOnScreenCondition instead — it keeps the splash on screen without blocking the main thread.
Animated splash icon
The animated icon must be an AnimatedVectorDrawable and comply with the system-imposed constraints:
- icon size: 108dp × 108dp (with 72dp visible area)
- animation will be cut off after 1000ms on Android 12
Baseline Profiles
Baseline Profiles tell the Android runtime which classes and methods to AOT-compile at install time, reducing interpreted/JIT overhead during cold start and critical user journeys.
Modules
Writing a Baseline Profile generator
Generating and committing the profile
Commit baseline-prof.txt to source control. It is applied at install time via profileinstaller.
profileinstaller dependency
No code needed — profileinstaller automatically applies the profile from baseline-prof.txt on install.
When to regenerate
- Before every release
- After adding new features to critical user journeys
- After significant navigation or startup logic changes
Cold Start Checklist
Setup
- [ ] StrictMode enabled in debug builds — fix all violations before release
- [ ] App Startup library adopted;
Application.onCreate()has no direct SDK inits
Main thread hygiene
- [ ] No disk reads/writes on main thread during startup
- [ ] No network calls on main thread during startup
- [ ] No
runBlockingorThread.sleepon main thread - [ ] No synchronous
SharedPreferencesreads inApplication.onCreate()— migrate to DataStore (see android-datastore-preferences)
Deferred work
- [ ] Third-party SDKs not needed for first frame are lazy-loaded via App Startup
- [ ] Heavy database initialization happens off main thread (Room uses a background thread by default)
- [ ] Analytics/crash SDK init is fast; heavy remote config fetch is deferred
SplashScreen
- [ ]
installSplashScreen()called beforesetContent() - [ ]
setKeepOnScreenConditionused for async data, notrunBlocking - [ ] Animated icon is an
AnimatedVectorDrawablewithin size constraints - [ ]
postSplashScreenThemecorrectly set to the real app theme
Baseline Profiles
- [ ]
BaselineProfileGeneratorcovers cold start and top user journeys - [ ]
baseline-prof.txtcommitted to source control - [ ]
profileinstallerdependency added to:app - [ ] Profile regenerated before each release
Measuring Startup Time
Use Macrobenchmark to get objective startup numbers:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/android-app-startup-bootstrap/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shekhar23/claude-zero-to-hero-android-kmp/android-app-startup-bootstrap)