SafeAlert is a native Android application designed to enhance personal security. Built with modern Android development standards (Kotlin & Jetpack Compose), it utilizes device hardware sensors and background services to automatically detect emergencies and notify trusted contacts with live location data.
- Hardware SOS Detection: Integrates with the device's Accelerometer to trigger an automatic SOS protocol if the user violently shakes the phone.
- Inactivity & Battery Monitoring: Automatically alerts trusted contacts if the device remains completely stationary for a user-defined period, or if the battery drops below 10%.
- Live Location Sharing: Fetches accurate GPS coordinates using
FusedLocationProviderand sends a Google Maps link via SMS to a preset list of emergency contacts. - Automated Audio Recording: Covertly records background audio using the device microphone when an emergency is triggered, saving it locally for later retrieval.
- Severe Weather Warnings: Connects to the OpenWeather API to monitor local meteorological data, automatically warning the user (and their contacts) of extreme conditions like thunderstorms.
- Modern UI: Built entirely with Jetpack Compose for a reactive, smooth, and modern user interface.
- Language: Kotlin
- UI Framework: Jetpack Compose, Material Design 3
- Hardware & APIs: Android SensorManager (Accelerometer), BatteryManager, MediaRecorder, SmsManager
- Location & Network: Google Play Services Location API, OpenWeather REST API
-
Clone the repository:
git clone https://github.com/yourusername/safealert-android.git
-
Open the project in Android Studio.
-
API Key Setup: Create a local.properties file in the root directory and add your OpenWeather API key:
OPEN_WEATHER_API_KEY="your_api_key_here"- Build and run the app on a physical Android device (emulators may not support hardware shaking or SMS dispatching).
Building SafeAlert pushed me to learn hardware-level Android development. I learned how to manage complex user permissions (Location, SMS, Contacts, Microphone), handle asynchronous API calls using Kotlin Coroutines, and read raw data from hardware sensors (like calculating G-force from accelerometer axes) to trigger background events.