How google/jetpack-camera-app works
Project type and purpose
• Jetpack Camera App (JCA) is a modular, multi-module Android camera application built in Kotlin using CameraX and Jetpack Compose.
• It serves as a reference implementation for camera features (image/video capture, HDR, multi-stream, dual concurrent camera, etc.) and follows Modern Android Development (MAD) best practices (MVVM, DI, modularization, thorough testing).
File structure
Top-level modules:
• app – the Android application module; hosts the AndroidManifest, MainActivity, navigation (Routes.kt), application class, and aggregates feature modules.
• feature/* – Compose-backed UI feature modules (preview, settings, permissions, postcapture). Each provides its own ViewModel, UI Composables, navigation routes, and tests.
• core/common – domain-level utilities, DI modules, tracing, ref-counted utilities.
• core/camera – camera-use-case implementations built atop CameraX and native C++ JNI hooks (opengl_debug_jni.cpp, etc.). Provides CameraUseCase abstractions, session management, effects pipeline.
• data/media – media repositories that wrap Android’s MediaStore for saving/c fetching media.
• data/settings – settings repository built on Proto-DataStore (local data store for app settings).
• benchmark – microbenchmark suite for startup, first-frame, capture latency.
• build scripts, CI (GitHub workflows), formatting (Spotless), wrapper.
README for architectural insights
• “Clear separation between UI and data layers.”
• “Split into multiple modules to isolate features, domain logic, data access, and native code.”
• MVVM: ViewModel in each feature, business logic in core modules, repositories in data modules.
Detailed coverage
• High-level module structure and dependencies.
• Drill down to show critical components: MainActivity → Routes → [feature modules].
• ViewModel dependencies on Repositories and UseCases.
• How settings flows from DataStore to UI, and how media flows from ImageCapture to MediaStore.
• JNI C++ effects pipeline in core/camera.