UltraWideCamera is an Android application designed to leverage the full power of your device's camera system, specifically focusing on ultra-wide-angle lenses.
The app's standout feature is its Dual Capture mode: with a single tap of the shutter button, it automatically captures two photos—one at standard 1x zoom and another at the maximum wide-angle setting supported by your device.
- Automatic Dual Capture: Captures a standard (1x) and an ultra-wide (minimum zoom) photo simultaneously.
- Intelligent Lens Detection: Uses both logical zoom ratios and physical focal length analysis (via
Camera2Interop) to identify and utilize ultra-wide hardware, even on devices where it's not exposed as a standard zoom level. - Manual Lens Toggling: Easily switch between the primary and ultra-wide lenses with dedicated UI buttons.
- Dynamic Zoom Control: Supports the full range of zoom available on your hardware.
- Organized Storage: Photos are automatically saved to a dedicated folder:
Pictures/UltraWideCamera. - Modern UI: Built entirely with Jetpack Compose for a fluid, responsive, and expressive user experience.
- CameraX: Utilizes Android's CameraX library for robust camera lifecycle management and image capture.
- Camera2 Interop: Hooks into the lower-level Camera2 API to query hardware characteristics like focal lengths for precise lens identification.
- Kotlin Coroutines: Manages the sequential capture process asynchronously to ensure a smooth UI.
- StateFlow: Uses
MutableStateFlowin theViewModelto provide a reactive UI state to the Compose layers.
- Clone the repository.
- Open the project in Android Studio.
- Build and run on a physical device (Emulators usually do not support multiple camera lenses or ultra-wide simulation).
- Grant Camera and Storage permissions when prompted.
MainActivity.kt: The entry point and Compose UI implementation.CameraViewModel.kt: The core logic for camera initialization, lens switching, and the dual-capture sequence.PhotoRepository.kt: Handles theMediaStoreinteractions for saving JPEG files with custom suffixes.
This project is for educational and personal use.