Skip to content

madhumithakk01/CoverCall---SOS-App

Repository files navigation

🚨 SOS Emergency Alert App

An Android emergency alert application that automatically captures evidence and sends alerts to emergency contacts with real-time location tracking.

πŸ“± Features

  • πŸ”’ Dual Password System: Dashboard access and emergency trigger via gallery password
  • πŸ“Έ Automatic Evidence Capture: rear camera photos + 5-second video
  • πŸ“ Real-time Location Tracking: GPS coordinates with accuracy information
  • πŸ’¬ SMS Alerts: Instant notifications to emergency contacts via Twilio
  • 🌐 Web Dashboard: Emergency contacts receive a web link to view all information
  • ☁️ Cloud Backup: All data securely stored in Firebase
  • 🎭 Decoy Gallery: Secret gallery access for emergency mode

πŸ—οΈ Technology Stack

Android App

  • Kotlin - Primary programming language
  • Jetpack Compose - Modern UI framework
  • Room Database - Local data persistence
  • CameraX - Camera functionality
  • WorkManager - Background task scheduling

Backend Services

  • Firebase Firestore - Real-time database
  • Firebase Storage - Media file storage
  • Firebase Functions - Serverless cloud functions
  • Firebase Hosting - Web dashboard hosting

Third-Party Services

  • Twilio - SMS notification service

πŸš€ Getting Started

Prerequisites

  1. Android Studio (Arctic Fox or newer)
  2. Firebase Account - Create one here
  3. Twilio Account - Sign up here
  4. Firebase CLI - Install via npm install -g firebase-tools

⚠️ Important: Credentials Setup

This repository contains placeholder credentials for security. Before running the app, you MUST set up your own credentials.

πŸ“– See detailed setup instructions in: CREDENTIALS_SETUP.md

Quick Setup Overview

  1. Firebase Setup

    • Create a Firebase project
    • Download google-services.json and replace in app/
    • Update Firebase config in public/index.html
  2. Twilio Setup

    • Get Twilio credentials from console
    • Update credentials in functions/index.js
  3. Android SDK

    • Delete local.properties (will be auto-generated)
    • Open project in Android Studio

For complete step-by-step instructions, see CREDENTIALS_SETUP.md.

πŸ“¦ Installation

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/SOS_PROJECT.git
cd SOS_PROJECT

2. Set Up Credentials

Follow the complete guide in CREDENTIALS_SETUP.md

3. Install Dependencies

# Firebase Functions dependencies
cd functions
npm install
cd ..

4. Open in Android Studio

  • Open Android Studio
  • Select "Open an Existing Project"
  • Navigate to the cloned repository
  • Wait for Gradle sync to complete

🎯 How It Works

Normal Mode

  1. User opens app and enters dashboard password
  2. Access to settings, emergency contacts, and app configuration
  3. Can test emergency features safely

Emergency Mode

  1. User opens gallery app and enters emergency (gallery) password
  2. App automatically activates emergency mode in background:
    • πŸ“Έ Captures 2 photos (front + rear camera)
    • πŸŽ₯ Records 5-second video
    • πŸ“ Gets precise GPS location
    • ☁️ Uploads all data to Firebase
    • πŸ’¬ Sends SMS alerts with web link to all emergency contacts
  3. Emergency contacts receive SMS with link to web dashboard
  4. Web dashboard displays location, photos, video, and incident details

πŸ“± App Structure

app/
β”œβ”€β”€ src/main/java/com/example/sosapp/
β”‚   β”œβ”€β”€ data/              # Data layer
β”‚   β”‚   β”œβ”€β”€ firebase/      # Firebase integration
β”‚   β”‚   β”œβ”€β”€ local/         # Room database
β”‚   β”‚   └── repository/    # Data repositories
β”‚   β”œβ”€β”€ ui/                # UI layer (Jetpack Compose)
β”‚   β”‚   β”œβ”€β”€ auth/          # Password screens
β”‚   β”‚   β”œβ”€β”€ dashboard/     # Main dashboard
β”‚   β”‚   β”œβ”€β”€ gallery/       # Decoy gallery
β”‚   β”‚   └── setup/         # Initial setup
β”‚   β”œβ”€β”€ services/          # Background services
β”‚   β”œβ”€β”€ workers/           # WorkManager tasks
β”‚   └── utils/             # Utility classes
β”œβ”€β”€ google-services.json   # Firebase config (needs setup)
└── build.gradle.kts       # Dependencies

functions/
β”œβ”€β”€ index.js              # Cloud Functions (needs Twilio setup)
└── package.json          # Node dependencies

public/
└── index.html            # Emergency web dashboard (needs Firebase config)

πŸ”§ Configuration Files

File Purpose Setup Required
app/google-services.json Firebase Android config βœ… Yes
public/index.html Firebase web config βœ… Yes
functions/index.js Twilio credentials βœ… Yes
local.properties Android SDK path Auto-generated

🌐 Deployment

Deploy Firebase Functions & Hosting

# Login to Firebase
firebase login

# Deploy everything
firebase deploy

Deploy only Functions

firebase deploy --only functions

Deploy only Hosting

firebase deploy --only hosting

πŸ§ͺ Testing

Test Twilio Integration

curl "https://YOUR-PROJECT.cloudfunctions.net/testTwilio?phone=+1234567890"

Test Emergency Alert

  1. Open app in Android Studio
  2. Enter setup credentials
  3. Add test emergency contacts
  4. Trigger emergency mode via gallery password
  5. Check Firebase Console for uploaded data
  6. Verify SMS received by contacts

πŸ”’ Security Features

  • βœ… All credentials sanitized for public repository
  • βœ… Dual password system for security
  • βœ… Encrypted password storage (BCrypt hashing)
  • βœ… Secure cloud storage (Firebase)
  • βœ… HTTPS communication
  • βœ… .gitignore configured to prevent credential leaks

🀝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Note: Never commit real credentials in pull requests!

πŸ“ License

This project is for educational purposes. Please use responsibly and in accordance with local laws regarding emergency services and personal safety applications.

⚠️ Disclaimer

This app is designed for emergency situations. Always contact local emergency services (911, 112, etc.) for immediate help. This app supplements but does not replace official emergency services.

πŸ› Known Issues

  • Camera permissions required for evidence capture
  • Location permissions required for GPS tracking
  • Background service may be restricted on some devices (battery optimization)
  • SMS delivery depends on Twilio account status and recipient network

πŸ“ž Support

For setup issues, please refer to:

  1. CREDENTIALS_SETUP.md - Setup instructions
  2. Firebase Documentation
  3. Twilio Documentation

πŸŽ“ Author

  • Built with ❀️ for emergency safety

πŸ”„ Version History

  • v1.0.0 - Initial release
    • Dual password system
    • Automatic evidence capture
    • SMS alerts via Twilio
    • Web dashboard
    • Cloud backup

⭐ If this project helped you, please consider giving it a star!

πŸ” Remember to set up your credentials before running! See CREDENTIALS_SETUP.md

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors