FastSplash is an Android sample that explores fast startup and animated, configurable event splashes that run in parallel with your primary content. It showcases Clean Architecture, Jetpack Compose and modular design via two reusable modules:
- EventSplash — lightweight splash/transition library (Compose-first, fluent API, Lottie/Image support).
- PerfTracker — tiny tracing utility for startup, FCP, FPT and custom marks.
The sample app is a movie browser that integrates both libraries and ships with repeatable benchmarks and scripts so you can reproduce the numbers on your device.
- ✅ Compose-first, animated splash screens (EventSplash)
- ✅ Repeatable startup metrics (PerfTracker + scripts)
- ✅ Clean Architecture + Hilt + Retrofit
- ✅ Reproducible results with Macrobenchmark / adb script
- Architecture Overview
- Project Structure
- High-Level Design
- Why EventSplash
- Modules Deep Dive
- EventSplash Library
- Performance Tracking
- Benchmark Results
- Setup Instructions
- Tech Stack
- Learning Objectives
This project follows Clean Architecture principles with clear separation of concerns across multiple layers. The architecture is designed to be scalable, testable and maintainable while demonstrating modern Android development practices.
- Presentation Layer: Jetpack Compose UI with ViewModels
- Domain Layer: Business logic and repository interfaces
- Data Layer: API services, data sources and repository implementations
- Custom Libraries: EventSplash for splash screens, PerfTracker for performance monitoring
FastSplash/
├── app/ # Main application module
│ ├── src/main/java/me/sankalpchauhan/fastsplash/
│ │ ├── data/ # Data layer
│ │ │ ├── api/ # API services and interceptors
│ │ │ ├── di/ # Data dependency injection
│ │ │ └── model/ # Data models and DTOs
│ │ ├── domain/ # Domain layer
│ │ │ ├── model/ # Domain models
│ │ │ └── repository/ # Repository interfaces
│ │ ├── presentation/ # Presentation layer
│ │ │ ├── base/ # Base UI components and theme
│ │ │ └── listing/ # Movie listing feature
│ │ ├── di/ # Application dependency injection
│ │ └── utils/ # Utility classes
│ └── build.gradle.kts # App module build configuration
├── eventsplash/ # Custom splash screen library
│ ├── src/main/java/me/sankalpchauhan/eventsplash/
│ │ ├── core/ # Core splash implementation
│ │ ├── model/ # Configuration models
│ │ ├── utils/ # Animation utilities
│ │ └── viewprovider/ # Splash view providers
│ └── build.gradle.kts # Library build configuration
├── PerfTracker/ # Performance tracking library
│ ├── src/main/java/me/sankalpchauhan/perftracker/
│ │ └── PerfTrace.kt # Performance tracing implementation
│ └── build.gradle.kts # Library build configuration
├── build.gradle.kts # Project build configuration
├── settings.gradle.kts # Project settings
└── local.properties.template # Template for API keys
The following diagram illustrates the high-level architecture and data flow of the FastSplash application:
EventSplash focuses on event splashes that run in parallel with your app’s main content render.
It does not route through a separate splash Activity and it does not block the primary page load.
Typical routing/“splash activity” patterns delay FCP/FPT; EventSplash is designed to avoid that.
The main application module demonstrates a complete implementation of a movie browsing app using modern Android development practices.
MainActivity: The single activity that hosts the entire application using Jetpack Compose. It demonstrates:
- Integration with the EventSplash library for custom splash screens
- Performance tracking using PerfTracker
- Edge-to-edge display implementation
- Proper lifecycle management
MainViewModel: Implements the MVVM pattern with:
- StateFlow for reactive UI updates
- Coroutines for asynchronous operations
- Search functionality with debouncing
- Pagination support
- Error handling and loading states
Repository Pattern: Clean separation between data sources and business logic:
- MoviesRepository interface in the domain layer
- Repository implementation in the data layer
- Dependency injection using Dagger Hilt
- User Interaction: User interacts with Compose UI
- ViewModel Processing: ViewModel processes user actions and updates state
- Repository Call: ViewModel calls repository methods
- API Request: Repository makes network calls via Retrofit
- State Update: Results flow back through StateFlow to update UI
A custom library for creating beautiful and performant splash screens with various animation options.
- Multiple Splash Types: Default, Image and Lottie animation support
- Customizable Animations: Fade out, zoom in, slide up, slide left
- Fluent API: Easy-to-use builder pattern
- Jetpack Compose: Built entirely with Compose for modern UI
- Lifecycle Aware: Proper cleanup and memory management
// Default
EventSplashApi.attachTo(this).show()
// Lottie
val lottieConfig = LottieConfig(
outAnimation = OutAnimType.SLIDE_LEFT,
outDuration = 200,
bgColor = listOf("#FFFF00"),
lottieComposition = composition
)
EventSplashApi.attachTo(this).with(lottieConfig).show()
// Image
val imageConfig = ImageConfig(
outAnimation = OutAnimType.FADE_OUT,
outDuration = 500,
bgColor = listOf("#FF5722", "#FFC107"),
drawable = customDrawable,
showDuration = 2000
)
EventSplashApi.attachTo(this).with(imageConfig).show()A lightweight performance tracking library for measuring application startup and rendering performance.
- Startup Time Tracking: Measure app launch performance
- First Contentful Paint (FCP): Track when first content appears
- Fully Painted Time (FPT): Measure complete page rendering
- Custom Metrics: Create custom performance traces
class FastSplashApplication: Application() {
val fcp = PerfTrace("FCP")
val pageRender = PerfTrace("RenderTrace")
val fpt = PerfTrace("FPT")
override fun onCreate() {
super.onCreate()
fcp.startTrace()
pageRender.startTrace()
fpt.startTrace()
}
}Methodology: Cold launches · identical device & build · 2s pause between runs · 35 runs (30 considered) Env: Xiaomi Poco F1 · Android 10 · Release build. Capture: PerfTracker logs (Page Load, First Contentful Paint (FCP), Fully Painted Time (FPT)). Scripts are included so you can reproduce these numbers locally:- Script:
perf_loop.sh
- It launches the app 35 times, waits for timeout, parses PERF logs:
PERF Page Ready <ms> PERF First Contentful Paint <ms> PERF Fully Painted Time <ms> PERF TRACE_STOPPED
Run:
bash perf_loop.sh→ outputsperf_runs.csv
Definitions:
Page Load = PerfTracker “Page Ready” marker.
FCP = first meaningful content visible.
FPT = first frame where target screen is fully painted.
| Metric | Blocking (ms) | Non-Blocking (ms) | Reduction |
|---|---|---|---|
| Page Load | 2228 | 109 | 95.1% |
| FCP | 2347 | 312 | 86.7% |
| FPT | 3524 | 1467 | 58.4% |
Non-blocking Lottie keeps the splash visual without delaying first meaningful paint. Note on Lottie: Case A Blocking includes the Lottie animation duration by design. For apples-to-apples “no animation budget” comparisons, see B and C.
| Metric | Blocking (ms) | Non-Blocking (ms) | Reduction |
|---|---|---|---|
| Page Load | 366 | 37 | 89.8% |
| FCP | 744 | 164 | 77.9% |
| FPT | 2195 | 1295 | 41.0% |
Non-blocking Splash keeps the splash visual without delaying first meaningful paint.
| Metric | Default Blocking (ms) | Lottie Non-Blocking (ms) | Reduction |
|---|---|---|---|
| Page Load | 366 | 109 | 70.3% |
| FCP | 744 | 312 | 58.0% |
| FPT | 2195 | 1467 | 33.2% |
Even against a “best-case” default blocking splash, the non-blocking event splash reduces user-perceived wait.
- Visit The Movie Database
- Create an account and request a free API key
- Copy
local.properties.templatetolocal.properties - Replace
YOUR_TMDB_API_KEY_HEREwith your actual API key
- Open in Android Studio
- Sync project
- Run the app
- Kotlin: Primary programming language
- Jetpack Compose: Modern UI toolkit
- Coroutines & Flow: Asynchronous programming
- Dagger Hilt: Dependency injection framework
- Retrofit: HTTP client for API calls
- OkHttp: HTTP client with interceptors
- Kotlinx Serialization: JSON serialization
- Material Design 3: Design system
- Coil: Image loading library
- Lottie: Animation library
- Core SplashScreen: System splash screen API
This project serves as a comprehensive learning resource covering:
- Clean Architecture implementation
- MVVM pattern with Jetpack Compose
- Repository pattern for data management
- Dependency injection with Dagger Hilt
- Modern UI development with Jetpack Compose
- Reactive programming with Coroutines and Flow
- Network programming with Retrofit
- Performance optimization techniques
- Creating reusable Android libraries
- API design and documentation
- Module separation and dependency management
- Publishing and distribution strategies
- Code organization and structure
- Error handling and edge cases
- Performance monitoring and optimization
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you want to connect or read more about the experiments, check out the links below:
- Blog: sankalpchauhan.com
- More about me: sankalpchauhan.me




