Engineering ProjectsAndroid ProjectsIT Projects

Stay Safe Security App with Scream and SOS Features

Introduction

In an age where personal safety is a growing concern in public spaces like train stations, footpaths, and bus stands, GuardianScream emerges as a reliable safe security app for everyone—women, men, and senior citizens.

Technical Framework

Powered by Google’s Dart programming language and SQLite for back-end data management, the app is built on the cross-platform Flutter framework. Android Studio serves as the official IDE for crafting this efficient and user-friendly app.

Key Features

  • Scream Alarms: Choose between male or female screams or police sirens as your alert sound. In times of danger, the alarm screams will go off, attracting attention and possibly deterring attackers.
  • Fake Call Function: Generate a fake call that lasts a minute to divert attention. The call will display the caller’s name and number.
  • Location Sharing: Easily share your live location via a web link with family members and friends who can then track you on Google Maps.
  • Quick Access List: A list of contacts is displayed in the app for immediate access during emergencies.
  • SOS Shake Feature: In dire situations, shake your mobile phone five times to send an email or SMS to your emergency contacts, complete with a location link.

Advantages

  • Easy to maintain and extremely user-friendly
  • An effective tool for self-defense, particularly for lone travelers
  • SOS and location-sharing features enable quick communication with family and friends
  • Scream alarms are a great way to deter attackers and attract attention

Sample Code

dependencies:
  flutter:
    sdk: flutter
  geolocator: ^8.0.0
  sensors: ^0.8.0
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:sensors/sensors.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  String _location = 'Unknown';
  List<double> _userAccelerometerValues = [0.0, 0.0, 0.0];
  int shakeCount = 0;

  @override
  void initState() {
    super.initState();
    userAccelerometerEvents.listen((UserAccelerometerEvent event) {
      setState(() {
        _userAccelerometerValues = <double>[event.x, event.y, event.z];
        if (event.x > 1.5 || event.y > 1.5 || event.z > 1.5) {
          shakeCount++;
          if (shakeCount > 4) {
            // Implement your SOS function here
            print("SOS Triggered");
            shakeCount = 0;
          }
        }
      });
    });
  }

  Future<void> _getCurrentLocation() async {
    final position = await Geolocator.getCurrentPosition(
        desiredAccuracy: LocationAccuracy.high);
    setState(() {
      _location = '${position.latitude}, ${position.longitude}';
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Safe Security App'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: _getCurrentLocation,
              child: Text('Share Location'),
            ),
            Text('Your current location is: $_location'),
            Text('Accelerometer: $_userAccelerometerValues'),
          ],
        ),
      ),
    );
  }
}
Click to rate this post!
[Total: 0 Average: 0]

Download Stay Safe Security App with Scream and SOS Features PDF


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button