Skip to content

AkshayKappala/StationeryTrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

41 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± StationeryTrade

Android Java Firebase Min SDK Target SDK

A mobile marketplace for buying and selling stationery products


πŸ“– Overview

StationeryTrade is an Android application that provides a platform for users to trade stationery items. The app enables users to create accounts, list their stationery products for sale, browse available items, and manage their advertisementsβ€”all through an intuitive mobile interface powered by Firebase real-time database.

Why StationeryTrade?

  • 🎯 Specialized marketplace focused on stationery items
  • πŸ” Secure authentication with phone number verification
  • πŸ“Έ Product listing with image uploads
  • πŸ’¬ Real-time database synchronization
  • πŸ“± Clean, material design UI

✨ Features

πŸ”‘ User Authentication

  • User registration with email and phone verification
  • Login with credentials and "Remember Me" functionality
  • Password reset via phone number verification
  • Firebase Phone Authentication integration

πŸ“¦ Product Management

  • Add new product listings with details and images
  • View all available products in a grid layout
  • Manage personal advertisements
  • Update or delete existing product listings

πŸ‘€ User Profile

  • View and edit profile information
  • Change password functionality
  • Logout and account management
  • Profile data persistence

🏠 Home Navigation

  • Bottom navigation with 4 main sections:
    • Home (Browse products)
    • Add Product
    • My Ads
    • Profile
  • ViewPager integration for smooth transitions

πŸ› οΈ Tech Stack

Technology Purpose
Java Primary programming language
Android SDK Mobile application framework (API 23-29)
Firebase Realtime Database Backend data storage and synchronization
Firebase Authentication Phone and email authentication
Firebase Storage Image and file storage
Picasso Image loading and caching
PaperDB Local data persistence
Material Components Modern UI design
Lottie Animations
RecyclerView & CardView Efficient list display

πŸš€ Quick Start

Prerequisites

  • Android Studio Arctic Fox or later
  • JDK 8 or higher
  • Android device/emulator with API level 23+
  • Firebase account and project setup

Installation

  1. Clone the repository

    git clone https://github.com/AkshayKappala/StationeryTrade.git
    cd StationeryTrade
  2. Open in Android Studio

    # Open Android Studio and select "Open an existing project"
    # Navigate to the cloned directory
  3. Configure Firebase

    • Create a new Firebase project at Firebase Console
    • Add an Android app to your Firebase project
    • Download google-services.json
    • Place it in the app/ directory
    • Enable Firebase Authentication (Phone & Email)
    • Enable Firebase Realtime Database
    • Enable Firebase Storage
  4. Sync Gradle

    # Android Studio will prompt you to sync
    # Or manually:  File β†’ Sync Project with Gradle Files
  5. Build and Run

    # Connect your Android device or start an emulator
    # Click Run (Shift + F10) or use: 
    ./gradlew assembleDebug
    ./gradlew installDebug

πŸ“ Project Structure

StationeryTrade/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/com/mainproject/stationerytrade/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Splash.java              # Splash screen activity
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ prelogin.java            # Pre-login welcome screen
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ login.java               # User login
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Registration.java        # New user registration
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ VerifyPhoneActivity.java # OTP verification
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ forgot.java              # Password recovery
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ PasswordReset.java       # Reset password
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Home.java                # Main app container
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ homeFragment.java        # Product browsing
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Faddpro.java             # Add product fragment
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ myadds.java              # My ads fragment
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ fprofile.java            # Profile fragment
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ proedit.java             # Edit profile
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ onclickProduct. java      # Product details
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ updateinfo.java          # Update product
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ UserDetail.java          # User data model
β”‚   β”‚   β”‚   β”‚   └── pageAdapter.java         # ViewPager adapter
β”‚   β”‚   β”‚   β”œβ”€β”€ res/
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ layout/                  # XML layouts
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ drawable/                # Images and icons
β”‚   β”‚   β”‚   β”‚   └── values/                  # Strings, colors, styles
β”‚   β”‚   β”‚   └── AndroidManifest.xml
β”‚   β”‚   └── build. gradle
β”œβ”€β”€ gradle/
β”œβ”€β”€ build.gradle
└── settings.gradle

πŸ”§ Configuration

Firebase Realtime Database Rules

{
  "rules": {
    "Users": {
      "$uid": {
        ".read": "$uid === auth.uid",
        ".write": "$uid === auth. uid"
      }
    },
    "Products": {
      ". read": true,
      ".write": "auth != null"
    }
  }
}

Firebase Storage Rules

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read:  if true;
      allow write: if request.auth != null;
    }
  }
}

Application Configuration

Update app/build.gradle if needed:

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.mainproject.stationerytrade"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
    }
}

πŸ“± Key Components

Authentication Flow

// User login with Firebase verification
DatabaseReference root = FirebaseDatabase.getInstance().getReference();
root.addListenerForSingleValueEvent(new ValueEventListener() {
    @Override
    public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
        // Verify user credentials
        // Navigate to Home activity on success
    }
});

Phone Verification

// Send OTP to user's phone
PhoneAuthProvider.getInstance().verifyPhoneNumber(
    mobile,
    60,
    TimeUnit.SECONDS,
    TaskExecutors.MAIN_THREAD,
    mCallbacks
);

Local Data Persistence

The app uses PaperDB for storing user session data:

// Remember user login
Paper.book().write("username", username);
Paper.book().write("password", password);

🎨 UI Highlights

  • Material Design: Modern UI with Material Components
  • Bottom Navigation: Easy access to 4 main sections
  • Grid Layout: Products displayed in 2-column grid using RecyclerView
  • Image Loading: Smooth image rendering with Picasso
  • Animations: Lottie animations for enhanced UX
  • Responsive: Supports various screen sizes (small to xlarge)

πŸ› Troubleshooting

Build Failures

Issue: Gradle sync fails

# Solution:  Clean and rebuild
./gradlew clean
./gradlew build

Issue: Firebase dependency conflicts

# Ensure google-services plugin is applied in app/build.gradle
apply plugin: 'com.google.gms.google-services'

Runtime Issues

Issue: App crashes on login

  • Verify google-services.json is in the correct location
  • Check Firebase Realtime Database is enabled
  • Ensure Firebase Authentication is configured

Issue: Images not loading

  • Check internet permissions in AndroidManifest.xml
  • Verify Firebase Storage rules allow read access
  • Confirm Picasso dependency is included

Issue: Phone verification not working

  • Enable Firebase Phone Authentication in Firebase Console
  • Check if SHA-1 fingerprint is added to Firebase project
  • Verify phone number format includes country code

πŸ“„ License

This project is available for educational and personal use.


πŸ‘€ Contact

Akshay Kappala


Built with ❀️ using Android & Firebase

⭐ Star this repo if you find it helpful!

About

Android app for seamless buying, selling, and management of stationery products using Firebase.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages