How ashansandeepa1/mypet-android-native-app works
The MyPet project is an Android application focused on providing a rich user experience for pet lovers, enabling pet management, access to pet care tips, marketplace functionality, and integration with Firebase services for backend functionality.
Project Type and Purpose
• The project is a mobile (Android) application developed using Java in Android Studio.
• It caters to pet management, including features like user login, pet details and health records, buying/selling, pet care tips, and a medical center locator.
• The app integrates with Firebase Firestore for data storage and Firebase Authentication for secure login.
File Structure
• The top-level “app” directory contains the bulk of the Android app code. Inside, the “src” folder is organized into different build types (e.g., “main”, “androidTest”, “test”), with the “main” directory including:
• Java code (under com/ashan/mypet) where activities (e.g., LoginActivity, MainActivity, RegisterActivity, etc.) and fragments (e.g., HomeFragment, ProfileFragment, MedicalFragment) are defined.
• AndroidManifest.xml defines the application’s components.
• Resources under “res” (layouts, drawables, menus, navigation) for UI design.
• The presence of Gradle build files (build.gradle.kts, settings.gradle.kts, gradlew) confirms the Gradle build system, and external configuration such as google-services.json for Firebase integration.
• Therefore the architecture separates the UI, application logic, and third-party services (Firebase).
Main Components
a. Android Application Layer:
• Activities and Fragments: These represent UI and navigation components (LoginActivity, MainActivity, HomeFragment, ProfileFragment, etc.).
• UI Elements: Layout files, menus, drawables, and navigation graphs (nav_graph.xml) that govern user interactions.
b. Business Logic and Data Handling:
• Java classes for data management (like Pet, HealthRecord, adapters for UI lists) that handle app-specific operations.
• Integration points for fetching, updating, or managing data.
c. Firebase Backend Services:
• Firebase Authentication: Handles secure user logins and registrations.
• Firebase Firestore: Serves as the database to store pet details, user profiles, health records, buying/selling items, etc.
d. Build and Integration:
• Gradle build configuration manages dependencies and project structure.
• Google Services JSON connects the app with Firebase services.
Architectural Patterns and Design Principles
• The project appears to follow a layered architecture where the UI (activities and fragments) interacts with business logic, and in turn, this business logic communicates with external backend services (Firebase).
• Even if not explicitly stated, the modularized code (separation of UI elements, data models, adapter classes) suggests adherence to separation of concerns and possibly an MVC or MVVM pattern.
• The navigation component aids in maintaining clear separation between different screens of the app.