Your AI-powered dog breed identification and exploration companion
Breedify is a production-ready Android application built with Jetpack Compose that combines advanced machine learning with comprehensive breed data to help users identify, explore, and learn about dog breeds. Featuring multiple AI-powered identification methods including Hugging Face models, TensorFlow Lite integration, and Google's Gemini AI, along with a beautiful, intuitive interface powered by The Dog API.
- Multiple ML Models: Hugging Face API integration with fallback models
- Primary: Microsoft ResNet-50
- Fallback: SkyAU Dog Breed Classifier ViT
- Tertiary: Google ViT Base Patch16-224
- TensorFlow Lite: Local on-device model for offline identification
- Gemini AI Integration: Google's advanced AI for breed analysis and chatbot
- Camera Integration: Real-time photo capture with CameraX
- Gallery Upload: Import photos from device gallery
- Confidence Scoring: Accuracy percentages for predictions
- Recommended Breeds: Curated list from The Dog API
- Quick Actions: Easy access to camera and upload features
- Daily Facts: Random dog breed facts
- Modern Design: Clean, pet-friendly interface with soft green theme
- Integrated Navigation: Custom bottom navigation with floating chatbot button
- The Dog API Integration: Real-time breed data from comprehensive database
- Smart Search: Find breeds by name with debounced search
- Comprehensive Database: Access to 200+ dog breeds with detailed information
- Pagination: Load more functionality with smooth animations
- Rich Breed Data: Temperament, size, origin, life span, and characteristics
- High-Quality Images: Professional breed photos from The Dog API
- Gemini AI Powered: Advanced conversational AI for breed questions
- Image Analysis: Upload photos for detailed breed analysis
- Breed Information: Get comprehensive breed details through chat
- Natural Language: Ask questions in plain English
- Comprehensive Information: Detailed breed characteristics
- Visual Gallery: Multiple high-quality breed images
- Breed Facts: Temperament, size, origin, and care requirements
- API Integration: Real-time data from The Dog API
- Save Breeds: Mark favorite breeds for quick access
- Persistent Storage: Favorites saved locally
- Easy Management: Add/remove favorites with simple tap
- Jetpack Compose: Modern declarative UI toolkit with Material Design 3
- Kotlin: 100% Kotlin codebase with coroutines and modern language features
- Custom Components: Reusable UI components with smooth animations
- Responsive Design: Optimized for different screen sizes and orientations
- Dark/Light Theme: Adaptive theming with system preferences
- MVVM: Model-View-ViewModel architecture with clear separation of concerns
- Repository Pattern: Clean data layer abstraction for API and local data
- Dependency Injection: Structured service locators with proper lifecycle management
- State Management: Reactive state handling with Compose and coroutines
- Error Handling: Centralized error management with user-friendly messaging
- Hugging Face API: Cloud-based breed identification with multiple model fallbacks
- Microsoft ResNet-50 (Primary model)
- SkyAU Dog Breed Classifier ViT (Fallback)
- Google ViT Base Patch16-224 (Tertiary)
- TensorFlow Lite: On-device model for offline processing and privacy
- Gemini AI: Google's generative AI for conversational chatbot and image analysis
- Image Processing: Optimized preprocessing pipeline with memory management
- The Dog API: Comprehensive breed database with 200+ breeds
- Retrofit: Type-safe HTTP client with coroutines support
- OkHttp: Network layer with interceptors for logging and authentication
- Gson: JSON serialization with custom adapters
- Coil: Efficient image loading with memory and disk caching
- Network Monitoring: Connection state awareness and offline handling
- CameraX: Modern camera API for photo capture with lifecycle awareness
- Accompanist Permissions: Runtime permission handling with rationale
- File Management: Secure file storage in app-specific directories
- Image Processing: Bitmap manipulation with memory optimization
- Gallery Integration: Photo picker with proper URI handling
- ProGuard/R8: Code obfuscation and optimization for release builds
- BuildConfig: Secure API key management through build system
- Certificate Pinning: Network security for production environments
- Root Detection: Security measures for sensitive operations
- Logging: Production-safe logging with debug removal
app/src/main/java/com/example/breedify/
βββ components/ # Reusable UI components
β βββ DogBreedCard.kt # Animated breed cards
βββ data/ # Data layer
β βββ api/ # API services and models
β β βββ DogApiService.kt # The Dog API interface
β β βββ GeminiApiService.kt # Gemini AI service
β β βββ HuggingFaceApiService.kt # ML model API
β βββ repository/ # Data repositories
β βββ DogRepository.kt # Breed data management
β βββ GeminiRepository.kt # AI service management
βββ navigation/ # Navigation components
β βββ BottomNavigation.kt # Custom bottom nav with cutout
βββ screens/ # Screen composables
β βββ homeScreen/ # Home with recommendations
β βββ exploreScreen/ # Search and browse breeds
β βββ cameraScreen/ # Camera for identification
β βββ chatbotScreen/ # AI-powered chatbot
β βββ dogDetailScreen/ # Detailed breed information
β βββ favoritesScreen/ # Saved favorite breeds
β βββ prediction/ # ML prediction results
β βββ welcomeScreen/ # App introduction
βββ ui/theme/ # Design system
β βββ Color.kt # Color palette
β βββ Theme.kt # Material theme
β βββ Type.kt # Typography
βββ utils/ # Utility classes
β βββ AppConfig.kt # App configuration and feature flags
β βββ CameraUtils.kt # Camera and image utilities
β βββ Constants.kt # App constants and configuration
β βββ ErrorHandler.kt # Centralized error handling and user messaging
β βββ Logger.kt # Production-safe logging utilities
β βββ MLUtils.kt # ML model utilities and image processing
β βββ NetworkUtils.kt # Network connectivity and monitoring
β βββ Result.kt # Result wrapper for safe API calls
βββ MainActivity.kt # Main activity with navigation
- Android Studio: Hedgehog | 2023.1.1 or newer (Iguana recommended)
- Android SDK: API 24 (Android 7.0) minimum, API 34+ recommended
- Kotlin: 1.9.0 or newer
- Java: JDK 11 or higher
- Gradle: 8.0+ (handled by wrapper)
-
Clone the repository
git clone https://github.com/gurnxxrpannu/Breedify.git cd Breedify -
Set up API keys Create
local.propertiesfile in the root directory:# SDK location (auto-generated by Android Studio) sdk.dir=/path/to/your/android/sdk # Required API Keys - Replace with your actual keys HUGGINGFACE_API_KEY=hf_your_huggingface_token_here GEMINI_API_KEY= DOG_API_KEY=your_dog_api_key_here
-
Get API Keys (Free tiers available)
- Hugging Face: Sign up β Settings β Access Tokens
- Gemini AI: Google AI Studio β Create API Key
- The Dog API: Register β Get free API key
-
Build and Run
# Open in Android Studio or use command line ./gradlew assembleDebug # Install on connected device ./gradlew installDebug
- Open Android Studio
- Select "Open an existing project"
- Navigate to the cloned Breedify directory
- Wait for Gradle sync to complete
- Connect device or start emulator
- Run the app (Shift+F10)
# Clean build
./gradlew clean
# Debug build
./gradlew assembleDebug
# Release build (requires signing setup)
./gradlew assembleRelease
# Run tests
./gradlew testThe app requests these permissions at runtime:
- Camera (
CAMERA): For capturing dog photos - Storage (
READ_EXTERNAL_STORAGE): For accessing gallery images - Internet (
INTERNET): For API calls and image loading - Network State (
ACCESS_NETWORK_STATE): For connectivity monitoring
- Background: Soft mint green (
#D4E6D4) - Primary: Blue accent (
#4A90E2) - Secondary: Green accent (
#5CB85C) - Cards: Pure white (
#FFFFFF) - Text Primary: Dark gray (
#2D3748) - Text Secondary: Medium gray (
#6B7280)
- Unique cutout design with floating paw button
- Smooth state transitions between screens
- Custom shape implementation with rounded corners
- Integrated chatbot access
- Animated breed cards with tap effects
- Skeleton loading states during data fetch
- High-quality image loading with Coil
- Responsive sizing for different screen densities
- Real-time search with debounced input
- Loading states management
- Pagination support for large datasets
- Base URL:
https://api.thedogapi.com/ - Endpoints Used:
/v1/breeds- Get all breeds/v1/breeds/search- Search breeds by name/v1/breeds/{id}- Get breed details/v1/images/{id}- Get breed images
- Features: Pagination, search, detailed breed information
- Models Used:
microsoft/resnet-50(Primary)skyau/dog-breed-classifier-vit(Fallback)google/vit-base-patch16-224(Tertiary)
- Input: Binary image data (JPEG/PNG)
- Output: Breed predictions with confidence scores
- Model:
gemini-1.5-flash - Capabilities:
- Image analysis and breed identification
- Natural language conversations about breeds
- Comprehensive breed information generation
# Run unit tests
./gradlew test
# Run instrumented tests
./gradlew connectedAndroidTest
# Generate test coverage report
./gradlew jacocoTestReport- Camera Functionality: Photo capture and processing
- Gallery Upload: Image selection and ML processing
- Search & Browse: Breed search with various queries
- Navigation: All screen transitions and back navigation
- API Integration: All API endpoints and error scenarios
- Network Handling: Offline mode and connectivity changes
- Permissions: Runtime permission flows
- Performance: Memory usage and app responsiveness
- UI/UX: Different screen sizes and orientations
- Release Build: Test with ProGuard enabled
- API Keys: Verify production API key configuration
- Performance: Memory leaks and battery usage
- Security: Network traffic and data protection
- Compatibility: Multiple Android versions (API 24-34)
- API Key Protection: All keys stored in
local.propertiesand BuildConfig - Code Obfuscation: ProGuard/R8 enabled for release builds
- Certificate Pinning: Network security for production (configurable)
- Root Detection: Security measures for sensitive operations
- No Hardcoded Secrets: All sensitive data externalized
- Secure Storage: App-specific directories for file storage
- Local Processing: TensorFlow Lite for on-device ML inference
- Minimal Data Collection: Only necessary data for functionality
- No User Tracking: No analytics or tracking without consent
- Secure Network: HTTPS-only API communications
- Data Retention: Images processed locally, not stored on servers
// ProGuard rules for security
-assumenosideeffects class android.util.Log {
public static *** d(...); // Removes debug logs
}
// API model protection
-keep class com.example.breedify.data.api.** { *; }- Offline Mode: Local breed database with Room
- Enhanced Search: Advanced filtering by size, temperament, energy
- Breed Comparison: Side-by-side breed analysis
- User Profiles: Personalized breed recommendations
- Favorites Sync: Cloud backup of favorite breeds
- Social Features: Share breeds and photos with community
- Push Notifications: Daily breed facts and care tips
- AR Features: Augmented reality breed identification
- Veterinary Integration: Connect with local vets and services
- Breeding Information: Responsible breeding resources
- Room Database: Local data persistence and caching
- Hilt/Dagger: Proper dependency injection framework
- Compose Navigation: Modern navigation component
- Paging 3: Efficient data loading and pagination
- WorkManager: Background sync and notifications
- Unit Tests: Comprehensive test coverage (target: 80%+)
- UI Tests: Automated UI testing with Espresso
- Performance: Memory optimization and startup time improvements
- Multi-language Support: Spanish, French, German, Japanese
- Regional Breed Data: Location-specific breed information
- Cultural Adaptation: Region-appropriate UI and content
We welcome contributions from the community! Here's how to get involved:
- Fork the repository on GitHub
- Clone your fork locally
git clone https://github.com/your-username/Breedify.git cd Breedify - Create a feature branch
git checkout -b feature/your-amazing-feature
- Set up your development environment
- Configure
local.propertieswith API keys - Sync project in Android Studio
- Run tests to ensure everything works
- Configure
- Kotlin Style: Follow official Kotlin coding conventions
- Architecture: Maintain MVVM pattern and repository structure
- Documentation: Add KDoc comments for public APIs
- Error Handling: Use centralized
ErrorHandlerfor user-facing errors - Testing: Write tests for new functionality
- Performance: Consider memory usage and network efficiency
- π Bug Fixes: Fix issues and improve stability
- β¨ Features: Add new functionality (discuss in issues first)
- π Documentation: Improve README, code comments, or guides
- π¨ UI/UX: Enhance user interface and experience
- β‘ Performance: Optimize code and reduce resource usage
- π§ͺ Testing: Add or improve test coverage
- Update documentation for any new features
- Add tests for new functionality
- Run all tests and ensure they pass
./gradlew test ./gradlew connectedAndroidTest - Update CHANGELOG.md with your changes
- Create a detailed pull request description
- Request review from maintainers
When reporting bugs, please include:
- Android version and device model
- App version and build type (debug/release)
- Steps to reproduce the issue
- Expected vs actual behavior
- Screenshots or logs if applicable
For new features, please:
- Check existing issues to avoid duplicates
- Describe the use case and benefits
- Consider implementation complexity
- Discuss with maintainers before starting work
This project is licensed under the MIT License - see the LICENSE file for details.
- The Dog API: Comprehensive dog breed database and images
- Hugging Face: Pre-trained machine learning models for breed identification
- Google Gemini AI: Advanced AI capabilities for chatbot and image analysis
- TensorFlow: Machine learning framework for on-device processing
- Jetpack Compose: Modern Android UI toolkit
- Material Design: Google's design system for beautiful interfaces
- Open Source Community: Amazing libraries and tools that made this possible
If you encounter any issues or have questions:
- Check the Issues: Look for existing solutions in GitHub Issues
- Create an Issue: Report bugs or request features
- Documentation: Refer to this README and inline code comments
- API Documentation: Check respective API documentation for service-specific issues
| Metric | Value |
|---|---|
| Language | 100% Kotlin |
| UI Framework | Jetpack Compose + Material Design 3 |
| Architecture | MVVM with Repository Pattern |
| API Integrations | 3 (The Dog API, Hugging Face, Gemini AI) |
| ML Models | Multiple Hugging Face models + TensorFlow Lite |
| Minimum SDK | API 24 (Android 7.0) |
| Target SDK | API 34 (Android 14) |
| Build System | Gradle with Kotlin DSL |
| Code Quality | ProGuard/R8 optimized, 0 deprecation warnings |
- Google Play Store: Coming soon
- GitHub Releases: Download APK
- Build from Source: Follow the Getting Started guide
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: gurnxxrpannu@gmail.com
- Documentation: Wiki
- β Production Ready: Fully optimized for release
- π Active Development: Regular updates and improvements
- π‘οΈ Security Audited: ProGuard enabled, secure API handling
- π± Cross-Device: Tested on phones and tablets
- π Open Source: MIT License, community contributions welcome