An Android emergency alert application that automatically captures evidence and sends alerts to emergency contacts with real-time location tracking.
- π 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
- Kotlin - Primary programming language
- Jetpack Compose - Modern UI framework
- Room Database - Local data persistence
- CameraX - Camera functionality
- WorkManager - Background task scheduling
- Firebase Firestore - Real-time database
- Firebase Storage - Media file storage
- Firebase Functions - Serverless cloud functions
- Firebase Hosting - Web dashboard hosting
- Twilio - SMS notification service
- Android Studio (Arctic Fox or newer)
- Firebase Account - Create one here
- Twilio Account - Sign up here
- Firebase CLI - Install via
npm install -g firebase-tools
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
-
Firebase Setup
- Create a Firebase project
- Download
google-services.jsonand replace inapp/ - Update Firebase config in
public/index.html
-
Twilio Setup
- Get Twilio credentials from console
- Update credentials in
functions/index.js
-
Android SDK
- Delete
local.properties(will be auto-generated) - Open project in Android Studio
- Delete
For complete step-by-step instructions, see CREDENTIALS_SETUP.md.
git clone https://github.com/YOUR_USERNAME/SOS_PROJECT.git
cd SOS_PROJECTFollow the complete guide in CREDENTIALS_SETUP.md
# Firebase Functions dependencies
cd functions
npm install
cd ..- Open Android Studio
- Select "Open an Existing Project"
- Navigate to the cloned repository
- Wait for Gradle sync to complete
- User opens app and enters dashboard password
- Access to settings, emergency contacts, and app configuration
- Can test emergency features safely
- User opens gallery app and enters emergency (gallery) password
- 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
- Emergency contacts receive SMS with link to web dashboard
- Web dashboard displays location, photos, video, and incident details
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)
| 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 |
# Login to Firebase
firebase login
# Deploy everything
firebase deployfirebase deploy --only functionsfirebase deploy --only hostingcurl "https://YOUR-PROJECT.cloudfunctions.net/testTwilio?phone=+1234567890"- Open app in Android Studio
- Enter setup credentials
- Add test emergency contacts
- Trigger emergency mode via gallery password
- Check Firebase Console for uploaded data
- Verify SMS received by contacts
- β All credentials sanitized for public repository
- β Dual password system for security
- β Encrypted password storage (BCrypt hashing)
- β Secure cloud storage (Firebase)
- β HTTPS communication
- β
.gitignoreconfigured to prevent credential leaks
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Note: Never commit real credentials in pull requests!
This project is for educational purposes. Please use responsibly and in accordance with local laws regarding emergency services and personal safety applications.
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.
- 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
For setup issues, please refer to:
CREDENTIALS_SETUP.md- Setup instructions- Firebase Documentation
- Twilio Documentation
- Built with β€οΈ for emergency safety
- 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