Skip to content

MarckRamon/GrabTrash-Mobile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

81 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌿 GrabTrash Mobile

Android Kotlin Firebase Jetpack Compose

GrabTrash (EcoTrack) is a modern Android mobile application designed to revolutionize waste management by connecting users with trash pickup services. Schedule pickups, track your orders, and contribute to a cleaner environment!


πŸ“‘ Table of Contents


✨ Features

πŸ‘€ For Users

Feature Description
User Authentication Secure login/registration
Security Questions Password recovery through security questions
Order Trash Pickup Schedule pickups with interactive map location selection
Multiple Payments Pay via GCash or Cash on Hand (Xendit integration)
Order History View past orders and download receipts
Push Notifications FCM-powered notifications for order updates
Profile Management Edit profile, change password, manage settings
Collection Schedule View scheduled garbage collection calendar
Cloud Storage FileLu integration for file uploads and management

πŸš› For Drivers

Feature Description
Driver Dashboard View and manage assigned job orders
Interactive Maps Navigation with collection point locations
Job Status Updates Update order status (Accept, In-Progress, Complete, Cancelled)
Order History View completed and cancelled job orders
Profile Management Manage driver profile and settings
Delivery History Track all past deliveries and pickups

πŸ› οΈ Tech Stack

Core Technologies

Category Technologies
Language Kotlin 1.9.x
Min SDK API 24 (Android 7.0 Nougat)
Target SDK API 34 (Android 14)
UI Framework Jetpack Compose + XML Views (Hybrid)
Architecture MVVM with ViewBinding

Services

Service Purpose
Firebase Auth User authentication
Firebase Firestore Database
Firebase Cloud Messaging Push notifications
Xendit Payment processing (GCash)
FileLu API Cloud file storage

Libraries & Dependencies

Library Version Purpose
Jetpack Compose BOM 2024.02.00 Modern UI toolkit
OSMDroid 6.1.16 OpenStreetMap integration
Retrofit 2.9.0 HTTP client
OkHttp 4.9.0 Network layer
Glide 4.16.0 Image loading
Coroutines 1.7.3 Async operations
BCrypt 0.10.2 Password hashing
kizitonwose/Calendar 2.5.1 Calendar view

πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Android Studio Hedgehog (2023.1.1) or newer
  • JDK 8 or higher
  • Git for version control
  • A physical Android device or emulator (API 24+)

Installation

  1. Clone the repository

    git clone https://github.com/MarckRamon/EcoTrack-Mobile.git
    cd EcoTrack-Mobile
  2. Open in Android Studio

    • Launch Android Studio
    • Select File β†’ Open
    • Navigate to the cloned directory and select it
    • Wait for Gradle sync to complete
  3. Create local.properties (if not exists)

    sdk.dir=C:\\Users\\YOUR_USERNAME\\AppData\\Local\\Android\\Sdk

Firebase Setup

  1. Create a Firebase Project

    • Go to Firebase Console
    • Click "Add project" and follow the wizard
    • Enter project name: EcoTrack , GrabTrash, or Similar
  2. Add Android App

    • Click "Add app" β†’ Select Android
    • Package name: com.example.grabtrash
    • App nickname: EcoTrack Mobile
    • Register the app
  3. Download Configuration

    • Download google-services.json
    • Place it in the app/ directory
  4. Enable Firebase Services

    In Firebase Console, enable the following:

    Service Settings
    Authentication Enable Email/Password sign-in
    Cloud Firestore Create database in production/test mode
    Cloud Messaging Enable for push notifications
  5. Firestore Security Rules (Development)

    rules_version = '2';
    service cloud.firestore {
      match /databases/{database}/documents {
        match /{document=**} {
          allow read, write: if request.auth != null;
        }
      }
    }

OpenStreetMap Setup

This project uses OpenStreetMap via the OSMDroid library. No API key is required!

  1. Permissions

    The following permissions are already configured in AndroidManifest.xml:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
  2. Configuration

    OSMDroid is configured in the app with:

    • Tile caching for offline support
    • Custom user agent for API compliance
    • Location services integration
  3. Usage

    The map is used in:

    • MapActivity.kt - Location selection for pickups
    • DriverMapActivity.kt - Driver navigation
    • PrivateEntityMapActivity.kt - Entity location management

πŸ’‘ Note: OpenStreetMap is free and open-source. No billing setup required!

Build and Run

# Build debug APK
./gradlew assembleDebug

# Install on connected device
./gradlew installDebug

# Or simply click the Run ▢️ button in Android Studio

πŸ“‚ Project Structure

EcoTrack-Mobile/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ src/main/
β”‚   β”‚   β”œβ”€β”€ java/com/example/grabtrash/
β”‚   β”‚   β”‚   β”œβ”€β”€ LoginActivity.kt           # User login
β”‚   β”‚   β”‚   β”œβ”€β”€ RegisterActivity.kt        # User registration
β”‚   β”‚   β”‚   β”œβ”€β”€ HomeActivity.kt            # Main home screen
β”‚   β”‚   β”‚   β”œβ”€β”€ ProfileActivity.kt         # User profile
β”‚   β”‚   β”‚   β”œβ”€β”€ ScheduleActivity.kt        # Collection schedule
β”‚   β”‚   β”‚   β”œβ”€β”€ DriverLoginActivity.kt     # Driver authentication
β”‚   β”‚   β”‚   β”œβ”€β”€ DriverHomeActivity.kt      # Driver dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ DriverMapActivity.kt       # Driver navigation
β”‚   β”‚   β”‚   β”œβ”€β”€ DriverJobOrderActivity.kt  # Job order management
β”‚   β”‚   β”‚   β”œβ”€β”€ ui/pickup/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OrderPickupActivity.kt     # Order creation
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ MapPickerActivity.kt       # Location selection
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PaymentMethodActivity.kt   # Payment selection
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OrderSuccessActivity.kt    # Success screen
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OrderStatusActivity.kt     # Order tracking
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ OrderReceiptActivity.kt    # Receipt display
β”‚   β”‚   β”‚   β”‚   └── model/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ PickupOrder.kt         # Order data model
β”‚   β”‚   β”‚   β”‚       └── PaymentMethod.kt       # Payment enum
β”‚   β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ FileLuService.kt           # Cloud storage API
β”‚   β”‚   β”‚   β”‚   └── EcoTrackFirebaseMessagingService.kt
β”‚   β”‚   β”‚   └── models/
β”‚   β”‚   β”‚       └── FileLuModels.kt            # FileLu data models
β”‚   β”‚   └── res/
β”‚   β”‚       β”œβ”€β”€ layout/           # XML layouts
β”‚   β”‚       β”œβ”€β”€ drawable/         # Icons, graphics, backgrounds
β”‚   β”‚       β”œβ”€β”€ values/           # Strings, colors, dimensions
β”‚   β”‚       β”œβ”€β”€ values-night/     # Dark theme resources
β”‚   β”‚       └── xml/              # Configurations
β”‚   β”œβ”€β”€ build.gradle.kts          # App-level build config
β”‚   └── google-services.json      # Firebase config (gitignored)
β”œβ”€β”€ gradle/                       # Gradle wrapper
β”œβ”€β”€ build.gradle.kts              # Project-level build config
β”œβ”€β”€ settings.gradle.kts           # Project settings
└── README.md                     # This file

πŸ—οΈ App Architecture

The app follows the MVVM (Model-View-ViewModel) architecture pattern:

flowchart TB
    subgraph UI["πŸ–₯️ UI Layer"]
        direction LR
        Activities["πŸ“± Activities<br/>(XML)"]
        Fragments["🧩 Fragments<br/>(XML)"]
        Compose["⚑ Jetpack Compose<br/>Screens"]
    end

    subgraph VM["βš™οΈ ViewModel Layer"]
        ViewModels["ViewModels with LiveData / StateFlow"]
    end

    subgraph Data["πŸ’Ύ Data Layer"]
        direction LR
        Firestore["πŸ”₯ Firebase<br/>Firestore"]
        Retrofit["🌐 Retrofit<br/>(REST API)"]
        LocalStorage["πŸ“¦ Local Storage<br/>SharedPrefs"]
    end

    subgraph External["☁️ External Services"]
        direction LR
        Auth["πŸ” Firebase<br/>Auth"]
        FCM["πŸ“¨ FCM"]
        Xendit["πŸ’³ Xendit"]
        OSM["πŸ—ΊοΈ OSM"]
        FileLu["πŸ“ FileLu"]
    end

    Activities --> ViewModels
    Fragments --> ViewModels
    Compose --> ViewModels
    ViewModels --> Firestore
    ViewModels --> Retrofit
    ViewModels --> LocalStorage
    Firestore --> Auth
    Firestore --> FCM
    Retrofit --> Xendit
    Retrofit --> FileLu
    LocalStorage --> OSM
Loading

Navigation Flow

flowchart TD
    Login["πŸ” Login Screen"]
    UserType{"πŸ‘€ User Type?"}
    
    Login --> UserType
    
    UserType -->|"Regular User"| UserHome["🏠 User Home"]
    UserType -->|"Driver"| DriverHome["πŸš› Driver Home"]
    
    subgraph UserFlow["πŸ‘€ User Flow"]
        UserHome --> OrderPickup["πŸ“¦ Order Pickup"]
        UserHome --> Schedule["πŸ“… Schedule"]
        UserHome --> Profile["πŸ‘€ Profile"]
        UserHome --> Notifications["πŸ”” Notifications"]
        UserHome --> MapPicker["πŸ—ΊοΈ Map View"]

        OrderPickup --> Payment["πŸ’³ Payment"]
        Payment --> OrderSuccess["βœ… Order Success"]
        OrderSuccess --> OrderStatus["πŸ“Š Order Status"]
    end
    
    subgraph DriverFlow["πŸš› Driver Flow"]
        DriverHome --> AvailableOrders["πŸ“‹ Available Orders"]
        DriverHome --> DriverMap["πŸ—ΊοΈ Driver Map"]
        DriverHome --> CompletedOrders["βœ… Completed Orders"]
        DriverHome --> DriverProfile["πŸ‘€ Driver Profile"]
        
        AvailableOrders --> JobOrder["πŸ“ Job Order Details"]
        JobOrder --> |"Accept"| ActiveJob["πŸ”„ Active Job"]
        ActiveJob --> |"Complete"| CompletedOrders
    end
Loading

πŸ“– API Documentation

Internal Documentation

Document Description
Implementation Manifest Detailed screen-by-screen implementation guide
FileLu Integration Cloud storage API integration guide

External Services

Service Documentation
Firebase Firebase Android Docs
OpenStreetMap OSMDroid Wiki
Xendit Xendit API Docs
FileLu FileLu API Reference

πŸ§ͺ Testing

Running Tests

# Run unit tests
./gradlew test

# Run instrumented tests
./gradlew connectedAndroidTest

# Run all tests with coverage
./gradlew testDebugUnitTestCoverage

Test Structure

app/src/
β”œβ”€β”€ test/                    # Unit tests
β”‚   └── java/com/example/grabtrash/
β”‚       └── utils/
β”‚           └── FileLuServiceTest.kt
└── androidTest/             # Instrumented tests
    └── java/com/example/grabtrash/
        └── ExampleInstrumentedTest.kt

🀝 Contributing

We welcome contributions! Please follow these steps:

Getting Started

  1. Fork the repository
  2. Clone your fork
    git clone https://github.com/YOUR_USERNAME/EcoTrack-Mobile.git
  3. Create a feature branch
    git checkout -b feature/amazing-feature
  4. Make your changes
  5. Commit with a descriptive message
    git commit -m "feat: add amazing feature"
  6. Push to your branch
    git push origin feature/amazing-feature
  7. Open a Pull Request

πŸ‘₯ Team

Marck Ramon
Marck Ramon

Lead Developer
Mykel Seth
Mykel Seth

Lead Developer

Contributors

Thanks to everyone who has contributed to this project!


πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 GrabTrash Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ™ Acknowledgments

  • Firebase for backend services
  • OpenStreetMap for free and open map data
  • OSMDroid for the Android map library
  • Xendit for payment processing
  • FileLu for cloud storage
  • All the amazing open-source libraries that made this project possible

GrabTrash Logo
GrabTrash Mobile
Made with πŸ’š for a cleaner environment

⭐ Star us on GitHub if this project helped you!

About

GrabTrash (EcoTrack) is a modern Android mobile application designed to revolutionize waste management by connecting users with trash pickup services. Schedule pickups, track your orders, and contribute to a cleaner environment!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages