https://github.com/samuel0122/android-camerax-mvvm
https://github.com/samuel0122/android-camerax-mvvm
android-app camerax camerax-api kotlin-android
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/samuel0122/android-camerax-mvvm
- Owner: samuel0122
- License: mit
- Created: 2024-11-01T14:11:37.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-15T20:11:06.000Z (10 months ago)
- Last Synced: 2025-03-04T06:12:12.562Z (7 months ago)
- Topics: android-app, camerax, camerax-api, kotlin-android
- Language: Kotlin
- Homepage:
- Size: 521 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android CameraX MVVM
*Capture photos, record videos, and preview media with modern Android development practices.*
This project demonstrates how to implement **CameraX** in an Android application using the **MVVM** (Model-View-ViewModel) view pattern, combined with a **Clean Architecture** architectural pattern. The project includes features like capturing photos, recording videos, and previewing media with modern Android development practices.
## 📋 Features
- 📸 **Capture Photos**: Take high-quality pictures using CameraX.
- 🎥 **Record Videos**: Record videos with CameraX and manage storage efficiently.
- 👀 **Media Preview**: Preview captured photos and videos.
- 🧱 **Clean Architecture**: Clean separation in layers: Domain, Data and View.
- 🎯 **Jetpack Components**: Uses Navigation, DataStore, and more.
- 💉 **Dependency Injection**: Powered by Dagger Hilt for modular and testable code.## 🛠️ Tech Stack
- **Kotlin**: 100% Kotlin-based code.
- **CameraX**: For camera functionality.
- **Jetpack**:
- Navigation Component
- DataStore for managing preferences
- ViewModel and LiveData for reactive UI updates
- **ExoPlayer**: For video playback.
- **Dagger Hilt**: Dependency Injection.## 🚀 Getting Started
### Prerequisites
1. Android Studio (latest stable version recommended)
2. Android SDK 21+### Setup
1. [ ] Clone the repository:
```bash
git clone https://github.com/samuel0122/Android-CameraX-MVVM.git
cd Android-CameraX-MVVM
```
2. [ ] Open the project in Android Studio.
3. [ ] Sync Gradle to download dependencies.
4. [ ] Run the app on a physical or virtual device.## 📂 Project Structure
```
📂 app/
├── 📂 core/ # Utility classes and extensions
├── 📂 data/ # Data layer (e.g., repositories, DataStore management)
├── 📂 di/ # Dependency injection modules
├── 📂 domain/ # Domain layer (Use Cases, models and mappers)
├── 📂 ui/ # View layer (Fragments, Adapters, ViewModels)
│ ├── 📂 camera/ # Media capture (photo/video) fragments and its ViewModels
│ ├── 📂 common/ # Common components that are shared along the whole app
│ ├── 📂 mainPage/ # Main app view and its ViewModel
│ ├── 📂 preview/ # Media preview (photo/video) fragments and its ViewModels
├── 🗒️ CameraXMvvmApp # Application class for global inyection
├── 🗒️ MainActivity # Application entry point and navigation host
```## 🧑💻 Author
- [@samuel0122](https://www.github.com/samuel0122)