Overview
This guide will walk you through cloning the repository, building the app, and logging in for the first time. By the end, you’ll have the app running on an Android device or emulator with a test user account.Before starting, ensure you’ve completed the Installation guide with Android Studio and Firebase configured.
Step 1: Clone the Repository
Step 2: Build the Project
Open in Android Studio
- Launch Android Studio
- Click Open an Existing Project
- Navigate to the cloned directory and click OK
- Wait for Gradle sync to complete
Sync Gradle Files
If Gradle doesn’t sync automatically:
- Click File > Sync Project with Gradle Files
- Wait for dependencies to download (first time may take 5-10 minutes)
Step 3: Set Up an Emulator or Device
You can run the app on an Android emulator or physical device:- Android Emulator
- Physical Device
Create a Virtual Device
- In Android Studio, click Tools > AVD Manager
- Click Create Virtual Device
- Select a device (e.g., Pixel 3)
- Choose a system image:
- Recommended: Oreo (API 26) or higher
- Minimum: Lollipop (API 22)
- Click Finish
Step 4: Run the Application
Step 5: Create Your First Account
Let’s create a test Sales Manager account:Navigate to Manager Sign Up
- On the login screen, tap “Sign up as a Manager”
- You’ll be taken to the Manager registration form
Fill Registration Form
Enter the following details:
- Name: Test Manager
- Email: [email protected]
- Password: test1234 (minimum 6 characters)
- Phone: +1234567890
- Company: Test Company
Password must be at least 6 characters as enforced by Firebase Authentication:
MainActivity.java:133
Complete Registration
- Tap Sign Up
- Wait for Firebase to create the account (2-3 seconds)
- You’ll be automatically logged in and redirected to the Manager dashboard
Explore Manager Dashboard
You’re now in the Manager interface! You can:
- My Team: View all salespersons (empty initially)
- Inventory: Add and manage products
- Chat: Access global chat room
- Graphs: View profit analysis (requires inventory data)
- Leaderboard: See top 10 salespersons
- Profile: Update your account details
Step 6: Test Core Features
Let’s add some inventory to see the app in action:Add Inventory Item
- Tap Inventory from the navigation menu
- Tap the + button (floating action button)
- Enter item details:
- Name: Laptop
- Total Available: 100
- Sold: 25
- Profit per unit: 200
- Tap Save
InventoryItem.java:11
Create a Salesperson Account
To test the full workflow:
- Log out from Manager account
- On login screen, tap “Sign up as a Salesperson”
- Register with different credentials:
- Email: [email protected]
- Password: test1234
- Explore the Salesperson dashboard
- View inventory (read-only)
- See their performance graphs
- Check leaderboard ranking
- Chat with the manager
Understanding User Roles
The app authenticates users and determines their role from Firebase:Next Steps
Chat Feature
Learn how to use the global chat room and personal messaging
Analytics & Graphs
Understand performance tracking and profit analysis
Inventory Management
Deep dive into adding, updating, and tracking inventory
API Reference
Explore the Java classes and Firebase structure
Troubleshooting
App Crashes on Launch
App Crashes on Launch
Problem: App crashes immediately after launchCommon causes:Verify Firebase configuration in Installation Guide.
- Missing or invalid
google-services.json - Firebase services not enabled
Authentication Failed
Authentication Failed
Problem: “Authentication failed” error on loginSolution:
- Verify Email/Password authentication is enabled in Firebase Console
- Check that password is at least 6 characters
- Ensure correct role is selected (Manager vs Salesperson)
- Verify internet connection (app requires network access)
Data Not Appearing
Data Not Appearing
Problem: Inventory or chat messages don’t show upSolution:
- Check Firebase Realtime Database rules:
- Verify internet connectivity
- Check Firebase Console to see if data is being written
- Look for permission errors in logcat
Images Not Loading
Images Not Loading
Problem: Profile pictures or images don’t displaySolution:
- Verify Firebase Storage is set up and accessible
- Check storage rules allow read/write
- Grant storage permissions:
AndroidManifest.xml:6
- Accept permission prompts when the app requests them
Having issues? Check the GitHub Issues or create a new issue with your error logs.
