Hey there, Hive community! I'm excited to share my latest project—born out of a sudden, startling realization that my side profile was beginning to resemble a small, rolling hill. ⛰️
The "Dad Bod" Intervention
A little while ago, I noticed my midsection had grown prominent enough to have its own zip code. Something had to be done. My wife, ever the strategist, reminded me of the calorie-tracking apps she’d used in the past. But then she dropped the ultimate bait: "Why don't you just build your own?".
She knows me too well. Tell me to "track my food" and I’ll forget by lunch; tell me to "build a complex piece of software from scratch," and I’m locked in for weeks.
What Does "CalorieTracker" Actually Do?
This isn't just a digital notebook; it's a full nutrition companion designed to keep you on top of your daily intake. I wanted something that felt smart, so I leaned heavily into AI and robust databases. Here’s the breakdown:
📸 AI Vision: You can snap a photo of your food, and the app uses Gemini AI to identify exactly what's on your plate.
🔍 The Edamam Library: For those moments when you need precision, I've integrated the Edamam food database. You can search for anything from "instant coffee" to a complex dinner and get back full nutritional breakdowns.
💧 Hydration Station: Because man cannot live on coffee alone, you can track your water and liquid consumption alongside your meals.
📊 Data-Driven Progress: You can log your weight daily and visualize the trend over time with historical charts showing your daily intake against targets.
From "Hello World" to "Goodbye Calories"
The journey starts with a smooth 4-step onboarding wizard. It takes your name and body metrics (age, weight, height, and gender), then asks about your activity levels and weight goals.
From there, everything is powered by the Mifflin-St Jeor equation to give you personalized nutrition targets. The home dashboard shows your daily progress at a glance—calories consumed, macros breakdown, water intake, and any meals you've already logged.
The AI in Action
The photo recognition is easily the most "magic" part of the app. It's incredibly satisfying when the tech nails your lunch. For example, check out how it handled my morning brew.
Starting the day right—snapping a coffee to log with AI.
I snapped a photo of my mug next to a tin of Nescafe Ricoffy. The AI didn't just guess "coffee"; it actually suggested the specific brand and a "coffee with milk" option.
The AI identified my meal from a single photo.
When I selected the Nescafe option, it correctly pulled the data for a standard 2.7g serving, clocking in at 9 kcal.
Found it—complete macros for a cup of coffee.
The Tech Under the Hood 🛠️
For the fellow devs on Hive, here is the stack I used to bring this to life:
- UI/UX: Jetpack Compose (a literal superpower for state management once it clicks).
- Database: Room for local storage.
- Logic: Hilt for dependency injection.
- Hardware: CameraX and ML Kit for barcode scanning.
- Brains: Edamam API and Google's Gemini API.
Keeping it Real (and Red)
The charts screen is my daily reality check. It lets me toggle between 7-day and 30-day views, with color-coded bars.
7-day calorie overview with target tracking.
Green means I’m on target, Orange means I’m close, and Red... well, let’s just say yesterday was a "Red" day at 112% of my goal.
Final Thoughts
This is my first mobile app. It’s not perfect, but it’s mine—and I use it every single day to help shrink that "hill" I noticed in the mirror.
I've learned that state management is a dream once it clicks, and that building something for yourself is the best way to stay motivated.
What do you use to stay on track with your fitness goals? Let me know in the comments!