Snap. Analyze. Track. A modern Android application that uses Google's Gemini AI to recognize food from photos and track your daily nutrition intake instantly.
CaloriLens is a native Android application built demonstrating modern Android development practices. It leverages on-device CameraX for image capture and Cloud AI for image recognition to provide a seamless calorie tracking experience.
This project was built to showcase:
- Integration of Generative AI (multimodal) in mobile apps.
- Modern Android Architecture (MVVM, Unidirectional Data Flow).
- Clean UI/UX implementation with Jetpack Compose.
- AI-Powered Food Recognition: Instantly identifies food items and estimates serving sizes using Gemini 2.5 Flash.
- Real-time Analysis: Calculates macros (Calories, Protein, Carbs, Fat) on the fly.
- Smart Viewfinder: Custom camera interface with smart cropping to focus on the food.
- Daily Dashboard: Integrated calendar and progress rings to track daily goals.
- Local Persistence: Saves full meal history locally using Room Database.
- Premium UI: Dark mode support, smooth transitions, and glassmorphism elements.
- Language: Kotlin
- UI Toolkit: Jetpack Compose (Material 3)
- Architecture: MVVM (Model-View-ViewModel)
- AI Model: Google Gemini 2.5 Flash (via Generative AI SDK)
- Camera: CameraX
- Storage: Room Database & DataStore
- Networking: Retrofit & OkHttp
- Image Loading: Coil
- Concurrency: Coroutines & Flow
- Android Studio Koala or newer.
- A Gemini API Key from Google AI Studio.
- Clone the repository:
git clone https://github.com/soneryesilay/CaloriLens.git
- Configure API Key:
- Create a file named
.envin the root directory. - Add your API key:
GEMINI_API_KEY=your_actual_api_key_here
- Create a file named
- Build & Run:
- Open the project in Android Studio.
- Sync Gradle.
- Run on an Emulator or Physical Device.
The app follows Clean Architecture principles:
- Data Layer: Repositories (
FoodRepository,MealRepository) handle data fetching from AI and local DB. - Domain/UI Layer: ViewModels (
FoodViewModel,LogViewModel) manage state and business logic. - UI: Composable functions rendering state (
Success,Loading,Error).
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by Soner Yesilay


