Project
Project
Project
1. INTRODUCTION
In today’s world, even though there are so many economic developments
in our country, but crimes against women are equally raising. Since we cannot travel with
them all the time, though it is necessary that they need protection. It is predictable that every
single one of them is having smart phones with them. So, this application is to provide
security through smart phones. This paper presents women security an Android Application
for the Safety of Women and this app has so many features like a call is sent on a single
shake and message is also sent to the emergency contacts with the present location of the
person in trouble.
Girls and Women at colleges and workstations or while returning from her
work through by bus, cab etc.; can’t send the status of current location. Although she is in
problem, she can’t share that to the known person. Security for women has become a major
issue as the number of crimes over women increasing day-by-day.
The main objective of the system is to track the current location of the
person which has an android enabled mobile by extracting the longitude and latitude of that
target person. In this fast-moving world, Women Security is a major issue of concern. We
have come across so many unfortunate incidents happening with women and the rate is
rapidly increasing day by day. Women these days are working women and the globalization
has made us aware of gender equality. Earlier there were so many restrictions for women
and the major belief was that they were only meant for household chores. With the changing
scenario, women are paving paths for themselves and proving that they are not less than
anyone. We can see women going to great success levels in all fields, may it be corporate,
scientific, education, business or any other field. Safety of women matters very much
whether at home or outside the home or even in the working place. In recent times there were
so many crimes evolving against women especially the case in Hyderabad was very dreadful
and fearful. Because of such crimes, women safety has become a major topic and it has
become a major trouble for girls in facing the world. According to the statistics, it is found
that every two out of three women have suffered trauma in the last year. According to the
survey of women, it is found that women are losing their confidence because of such
incidents. By the survey of Central government’s Women and Child Development
Department, around 80% of the women in national capital have fear regarding their own and
others’ lives. There is no time and place for women getting harassed because as we have
seen every now and then, the news and reports are really of concern. Even if it is day or
night, young or old every single woman is getting harassed. Actually, women kind of lost
their faith in police officials, if not it are decreasing as the crime scenes are increasing and
when the criminals get unpunished it makes no sense to trust the government. There is a
tremendous need to understand and resolve this problem of women safety so that they can
grow like men. It is a personal safety product designed to guard you and your friends for
24/7. It is user-friendly application and can be accessed by anyone who has installed it in their
smart phones.
Our intention is to provide you with fastest and simplest way to ask for
help. The basic approach (single click) is to convey the instant location and a distress
message to the registered emergency numbers, so that unfortunate incident can be averted
and to provide real time evidence for the action against the committers of crime. This can
also help the police to reduce the crime rate against women and the evidence can be used for
tracing the culprits. This application helps to take preventive measures as soon as possible
during:
• Being stalked while moving.
• Attempt of physical or sexual assault.
• Unsafe neighbors.
• Domestic violence.
2. LITERATURE SURVEY
The Literature review plays a very important role in the research process. It is a source from here
research ideas are drawn and developed into concepts and finally theories. It also provides the
researchers a bird’s eye view about the research done in that area so far. Depending on what is
observed in the literature review, a researcher will understand where his/her research stands. Here
in this literature survey, all primary, secondary and tertiary sources of information were searched.
A literature survey or literature review means that researcher read and report on what the literature
in the field has to say about the topic or subject.
The status of women in India has gone through many great changes over
the past few millennia. From equal status with men in ancient times through the low
points of the medieval period to the promotion of equal rights by many reformers, the
history of women in India has been eventful. In modern India, women have adorned
high offices in India including that of the President, Prime Minister, Leader of the
Opposition and Speaker of the Lok Sabha. However, women in India continue to face
social challenges and are often victims of abuse and violent crimes and, according to
a global poll conducted by Thomson Reuters, India is the fourth most dangerous
country in the world for women. Problems may come from any direction such as
women walking on the road after the work, going to super market or many other
reasons for which they go alone. People at home are not sure of their return safely.
Another factor is woman die without knowing the reason as they attend excursions and
industrial trips conducted by the organizations. It happens due to attacks on woman but
not suicides. In 2013 there happened an incident which is a gag rape in New Delhi in
the case of 23-year-old woman in bus at 9:30 PM. Another incident that has taken
place at Mumbai in the case of woman who is leaving her native place after Christmas
holidays has been kidnapped and killed. These are some of the problems that have
taken place in the day-to-day life of women. In order to overcome such problems faced
by women the I Safety (women security apps) mobile based application is not only
necessary to use but also plays a pivotal role with android software. This project
focuses on a security system that is designed solely to serve the purpose of providing
security to women so that they never feel helpless while facing such social challenges.
This project describes a GPS and GSM based vehicle tracking and
women employee security system that provides the combination of GPS device and
specialized software to track the vehicles location as well as provide alerts and
messages with an emergency button trigger. The information of vehicle position
provided by the device can be viewed on Google maps. The ITcompanies are looking
forward to the security problem and require a system that will efficiently evaluate the
problem of women employee’s security working in night shifts. This project focuses
on the proposed model that can be used to deal with the problem of security issues of
women employees using GPS and GSM based vehicle tracking.
send a Glympse to let friends and family know you are on your way. Request a
Glympse from a colleague who is always running late.
3. PROBLEM IDENTIFICATION
3.1 PROBLEM DEFINITION
Girls and Women at colleges and workstations or while returning from her work through
by bus, cab etc.; can’t send the status of current location. Although she is in problem, she can’t
share that to the known person. Security for women has become a major issue as the number of
crimes over women increasing day-by-day.
The main purpose the project is to provide highly reliable security system for the safety of
women. The proposed system is based advanced sensors, Microcontroller and GSM. The basic
aim of the system is to develop a low-cost solution for GPS based women tracking system (women
safety system).
The main objective of the system is to track the current location of the person which has
an android enabled mobile by extracting the longitude and latitude of that target person.
3.2.1 Keeping the same concern in mind many developers have come up with innovative
applications. Few of such applications are as follows VithU App: This is an
emergency app initiated by a popular Indian crime television series “Gumrah” aired
on Channel [V].
In this app when the power button of the Smartphone is pressed twice consecutively, it will
begin sending out alert messages with a link to the location of the user every two minutes to the
contacts fed into the app.
3.2.3 Disadavanatages:
All the existing systems must be connected to the GPRS service to work properly, hence
cannot be used during emergency if there is no internet connectivity and also the network signals
problems.
3.3 REQUIREMENTS
HARDWARE REQUIREMENTS
4. DESIGN
4.1 SYSTEM ARCHITECTURE
1. The data structures needed for implementing the software as well-as the operations that can be
applied on them should be identified.
2. A data dictionary should be developed to depict how different data objects interact with each other
and what constraints are to be imposed on the elements of data structure.
3. Stepwise refinement should be used in data design process and detailed design decisions should
be made later in the process.
4. Only those modules that need to access data stored in a data structure directly should be aware of
the representation of the data structure.
5. A library containing the set of useful data structures along with the operations that can be
performed on them should be maintained.
6. Language used for developing the system should support abstract data types.
The structure of data can be viewed at three levels, namely, program component level, application
level, and business level. At the program component level, the design of data structures and the
algorithms required to manipulate them is necessary, if high-quality software is desired. At
the application level, it is crucial to convert the data model into a database so that the specific
business objectives of a system could be achieved. At the business level, the collection of
information stored in different databases should be reorganized into data warehouse,
which enables data mining that has an influential impact on the business.
In an information system, input is the raw data that is processed to produce output. During the
input design, the developers must consider the input devices such as PC, MICR, OMR, etc.
Therefore, the quality of system input determines the quality of system output. Well-designed input
forms and screens have following properties −
• It should serve specific purpose effectively such as storing, recording, and retrieving the
information.
• All these objectives are obtained using the knowledge of basic design principles regarding
• To design source documents for data capture or devise other data capture methods
It is important to design appropriate data input methods to prevent errors while entering data. These
methods depend on whether the data is entered by customers in forms manually and later entered
by data entry operators, or data is directly entered by users on the PCs.
Input integrity controls include a number of methods to eliminate common input errors by end-
users. They also include checks on the value of individual fields; both for format and the
completeness of all inputs.
Audit trails for data entry and other system operations are created using transaction logs which
gives a record of all changes introduced in the database to provide security and means of recovery
in case of any failure.
The design of output is the most important task of any system. During output design, developers
identify the type of outputs needed, and consider the necessary output controls and prototype report
layouts.
• To develop output design that serves the intended purpose and eliminates the production of
unwanted output.
• To develop the output design that meets the end users requirements.
• To form the output in appropriate format and direct it to the right person.
External Outputs
Manufacturers create and design external outputs for printers. External outputs enable the system
to leave the trigger actions on the part of their recipients or confirm actions to their recipients.
Some of the external outputs are designed as turnaround outputs, which are implemented as a form
and re-enter the system as an input.
Internal outputs
Internal outputs are present inside the system, and used by end-users and managers. They support
the management in decision making and reporting.
As soon as the first iteration of architectural design is complete, component-level design takes
place. The objective of this design is to transform the design model into functional software. To
achieve this objective, the component-level design represents -the internal data structures and
processing details of all the software components (defined during architectural design) at an
abstraction level, closer to the actual code. In addition, it specifies an interface that may be used
to access the functionality of all the software components.
The component-level design can be represented by using different approaches. One approach is to
use a programming language while other is to use some intermediate design notation such as
graphical (DFD, flowchart, or structure chart), tabular (decision table), or text-based (program
design language) whichever is easier to be translated into source code.
The component-level design provides a way to determine whether the defined algorithms, data
structures, and interfaces will work properly. Note that a component (also known as module) can
be defined as a modular building block for the software. However, the meaning of component
differs according to how software engineers use it. The modular design of the software should
exhibit the following sets of properties.
GPS device must to be placed inside the device (Android Phone). The device will
providethe position Information such as latitude, longitude of her location. An emergency
button will be placed in this system. Click on Rescue button alert will be immediately sent
to the nearest police station, contacts which are saved and enabled in that application.
Then it is the responsibility of police squad or family members or friends, which contacts
are saved and enabled to handle the situation All the existing systems must be connected to
the GPRS service to work properly. Hence cannot be used during emergency if there is no
internet connectivity and also the network signals problems
The proposed system is especially for the women safety and overcomes the
disadvantagesof existing system. With respect to time, gives quick response and does not
long. It doesn’t require any cost implementation. So, it is cost efficient.
User interface is the front-end application view to which user interacts in order to use the software.
The software becomes more popular if its user interface is:
• Attractive
• Simple to use
• Clear to understand
1. Command Line Interface: Command Line Interface provides a command prompt, where the user
types the command and feeds to the system. The user needs to remember the syntax of the
command and its use.
2. Graphical User Interface: Graphical User Interface provides the simple interactive interface to
interact with the system. GUI can be a combination of both hardware and software. Using GUI,
user interprets the software.
The analysis and design process of a user interface is iterative and can be represented by a spiral
model. The analysis and design process of user interface consists of four framework activities.
1. User, task, environmental analysis, and modeling: Initially, the focus is based on the profile of
users who will interact with the system, i.e. understanding, skill and knowledge, type of user, etc,
based on the user’s profile users are made into categories. From each category requirements are
gathered. Based on the requirements developer understand how to develop the interface. Once all
the requirements are gathered a detailed analysis is conducted. In the analysis part, the tasks that
the user performs to establish the goals of the system are identified, described and elaborated. The
analysis of the user environment focuses on the physical work environment. Among the questions
to be asked are:
• Will the user be sitting, standing, or performing other tasks unrelated to the interface?
2. Interface Design: The goal of this phase is to define the set of interface objects and actions i.e.
Control mechanisms that enable the user to perform desired tasks. Indicate how these control
mechanisms affect the system. Specify the action sequence of tasks and subtasks, also called a user
scenario. Indicate the state of the system when the user performs a particular task. Always follow
the three golden rules stated by Theo Mandel. Design issues such as response time, command and
action structure, error handling, and help facilities are considered as the design model is refined.
This phase serves as the foundation for the implementation phase.
3. Interface construction and implementation: The implementation activity begins with the creation
of prototype (model) that enables usage scenarios to be evaluated. As iterative design process
continues a User Interface toolkit that allows the creation of windows, menus, device interaction,
error messages, commands, and many other elements of an interactive environment can be used
for completing the construction of an interface.
4. Interface Validation: This phase focuses on testing the interface. The interface should be in such a
way that it should be able to perform tasks correctly and it should be able to handle a variety of
tasks. It should achieve all the user’s requirements. It should be easy to use and easy to learn. Users
should accept the interface as a useful one in their work.
Golden Rules:
The following are the golden rules stated by Theo Mandel that must be followed during the design
of the interface.
• Define the interaction modes in such a way that does not force the user into unnecessary or
undesired actions: The user should be able to easily enter and exit the mode with little or no effort.
• Provide for flexible interaction: Different people will use different interaction mechanisms, some
might use keyboard commands, some might use mouse, some might use touch screen, etc, Hence
all interaction mechanisms should be provided.
• Allow user interaction to be interruptible and undoable: When a user is doing a sequence of actions
the user must be able to interrupt the sequence to do some other work without losing the work that
had been done. The user should also be able to do undo operation.
• Streamline interaction as skill level advances and allow the interaction to be customized: Advanced
or highly skilled user should be provided a chance to customize the interface as user wants which
allows different interaction mechanisms so that user doesn’t feel bored while using the same
interaction mechanism.
• Hide technical internals from casual users: The user should not be aware of the internal technical
details of the system. He should interact with the interface just to do his work.
• Design for direct interaction with objects that appear on screen: The user should be able to use the
objects and manipulate the objects that are present on the screen to perform a necessary task. By
this, the user feels easy to control over the screen.
• Reduce demand on short-term memory: When users are involved in some complex tasks the
demand on short-term memory is significant. So the interface should be designed in such a way to
reduce the remembering of previously done actions, given inputs and results.
• Establish meaningful defaults: Always initial set of defaults should be provided to the average
user, if a user needs to add some new features then he should be able to add the required features.
• Define shortcuts that are intuitive: Mnemonics should be used by the user. Mnemonics means the
keyboard shortcuts to do some action on the screen.
• The visual layout of the interface should be based on a real-world metaphor: Anything you
represent on a screen if it is a metaphor for real-world entity then users would easily understand.
• Allow the user to put the current task into a meaningful context: Many interfaces have dozens of
screens. So it is important to provide indicators consistently so that the user know about the doing
work. The user should also know from which page has navigated to the current page and from the
current page where can navigate.
• Maintain consistency across a family of applications: The development of some set of applications
all should follow and implement the same design, rules so that consistency is maintained among
applications.
UML DIAGRAM
Activity diagram are graphical representations of work flows of step wise activities and actions
with support for choice, iteration and concurrency, in the unified modeling language, activity
diagrams can be used to describe the business and operational step-by-step work flows of
components in a system. An activity diagram shows the over all flow of control.
Login
Invalid
Check
Valid
List of contacts
logout
Remove
User
Edit / delete
Track/Add Lang/Latitude
Click rescue
Bottom
Location will
be sent to the
contacts
emergenc
Emerge-
Data y
ncy
Base
contacts
Server
GPSdat dat
SMS/
a a
Activati
MMS
-on
comprised of four activities architectural design, data structure design, interface design and
procedural design.
5. TESTING
The Common view of testing held by users is that it is preformed to improve that there are
no errors in a program. This is extremely difficult since designer cannot proveto be one hundred
percent accurate. Therefore, the most useful and practical approach is with the understanding that
testing is the process of executing a program with explicit intention of finding errors that make the
program fail.
Testing has its own cycle. The testing process begins with the product requirements phase
and from there, parallels the entire development process. In other words, for each phase of the
development process there is an important testing activity. Successful testingrequires a methodical
approach. It requires the focus on basic critical factors:
➢ Planning
➢ Risk management
➢ Measurement tools
Unfortunately there is no clear and common set of definitions with the testing industry,
many of the terms are overridden and vary from organization to organization. You should
determine early on in your project what definitions your organization uses. System Testing (ST)
is a black box testing technique performed to evaluate the complete system the system's
compliance against specified requirements. In System testing, the functionalities of the system are
tested from an end-to-end perspective.
System Testing is usually carried out by a team that is independent of the development
team in order to measure the quality of the system unbiased. It includes both functional and Non-
Functional testing. It is a level of testing that validates the complete and fully integrated software
product. The purpose of a system test is to evaluate the end-to-end system specifications.Usually,
the software is only one element of a larger computer-based system. Ultimately,the software is
interfaced with other software/hardware systems. System Testing isactually a series of different
tests whose sole purpose is to exercise the full computer- based system.
Level of Testing
The term end-to-end testing is also used in many organizations and tends to refer to a
combination of Systems Testing and Systems Integration Testing. Also, in some organizations the
term Systems Testing is used interchangeably with end-to-end testing. This methodology adopts
the terms as defined in the table above.
Typically Systems Testing and Systems Integration Testing will happen in the same test
environment. Initially the ‘system’ (which may itself be an integrated set of subsystems) will be
tested with a view to ensuring that the functionality of that system works, any interface files created
for external systems will be verified but not passed to the external system. Later in the Systems
Integration Testing phase the functions (or a selection of them) will be performed again and the
resulting interface files will be passed to the external systems to verify the end-to-end processing.
This is why in many organizations the terms Systems Testing, Systems Integration Testing and
End- to-End Testing are used interchangeably.
Regardless of what V-Model your organization has adopted all levels of testing should aim
to be efficient and effective. We should not be repeating tests unnecessarily between different
testing levels, it is acceptable to repeat tests across levels but only if it adds value. Test
Environments are an expensive resource and should be used wisely. We need to be aware of what
levels of testing have occurred and what level of 'certainty' has been gained about the software.
We should be aiming to focus our efforts on testing areas where there is less 'certainty' about the
software.
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product, it provides a way to check the functionality
of components, sub-assemblies, assemblies and/or a finished product It is the process of exercising
software with the intent of ensuring that the Software system meets its requirements and user
expectations and does not fail in an unacceptable manner. There are various types of test. Each test
type addresses a specific testing requirement.
Objectives of Testing
5.2.1 : Login of Safty App server. The Expected Output is Login or Register page
5.2.2 : Registration of Data Holder for the field “CONTACT DETAILS”. The Expected output
of this test case is Registration Sucessful
During testing the program to be tested is executed with a set of test cases and output of
the program for the test cases is evaluated to determine if the program is performing as expected.
To accomplish this objectives test case design techniques are used:
o Unit Testing.
o Integration Testing.
o User Acceptance Testing.
o Output Testing.
o Validation Testing.
Unit Testing
Unit testing focuses verification effort on the smallest unit of Software design that is the
module. Unit testing exercises specific paths in a module’s control structure to ensure complete
coverage and maximum error detection. This test focuses on each module individually, ensuring
that it functions properly as a unit. Hence, the naming is Unit Testing.
During this testing, each module is tested individually and the module interfaces are
verified for the consistency with design specification. All important processing path are tested for
the expected results. All error handling paths are also tested.
Integration Testing
Integration testing addresses the issues associated with the dual problems of verification
and program construction. After the software has been integrated a set of high order tests are
conducted. The main objective in this testing process is to take unit tested modules and builds a
program structure that has been dictated by design.
2. Bottom-up Integration
This method begins the construction and testing with the modules at the lowest level in the
program structure. Since the modules are integrated from the bottom up, processing required for
modules subordinate to a given level is always available and the need for stubs is eliminated. The
bottom up integration strategy may be implemented with the following steps:
▪ The low-level modules are combined into clusters into clusters that perform a
specific Software sub-function.
▪ A driver (i.e.) the control program for testing is written to coordinate test case input and
output.
The bottom up approaches tests each module individually and then each module is module is
integrated with a main module and tested for functionality.
User Acceptance of a system is the key factor for the success of any system. The system
under consideration is tested for user acceptance by constantly keeping in touch with the
prospective system users at the time of developing and making changes wherever required. The
system developed provides a friendly user interface that can easily be understood even by a person
who is new to the system.
Output Testing
After performing the validation testing, the next step is output testing of the proposed
system, since no system could be useful if it does not produce the required output in the specified
format. Asking the users about the format required by them tests the outputs generated or displayed
by the system under consideration.
Unit testing is usually conducted as part of a combined code and unit test phase of the
software lifecycle, although it is not uncommon for coding and unit testing to be conducted as two
distinct phases.
Field testing will be performed manually and functional tests will be written in detail.
Test objectives
Features to be tested
Test Results: All the test cases mentioned above passed successfully. No defects encountered.
Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.
The task of the integration test is to check that components or software applications, e.g.
components in a software system or – one step up – software applications at the company level –
interact without error.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.
User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional requirements.
Test Results: All the test cases mentioned above passed successfully. No defects encountered.
6. IMPLEMENTATION
This system is configured such a way that it will be unique from other existing app by integrating
all the features offered by those. The user needs to start the application by registering. User can
login with the registered email and password. User has to put three contact numbers manually.
Every time the user uses this application, user needs to start the app by turning on the on /Off
button to start the service. Then the app will start processing until the user turns it off. Whenever
the user presses the service key or screams with the voice command the app will start its emergency
service and will send alert message containing the user‟s name with the location to the registered
contacts.
Also, there is a system of live streaming. When the user travels from one place to another. There
is a system of audio record.
After getting the command the system will start recording the surrounding for the time so that the
user can use it later as a proof.
Most of the application which helps women in real time either contain one of the features. For
example, alert message sent during emergency, audio recording, live location tracking, only online
mode working. Either of the application contains one of the above features not all of them. So that
full-fledged application is in demand to protect the women safety.
Generally, application contains advanced features which are completely assisted by the
government, failure in any of the parts may leads to the problem. Different kinds of accessing
methods are not available in the existing system. For example, I go safety app consist of feature
sends a 30 seconds audio recording and video clip to the registered contacts along with emergency
message.
The app is activated if the user shakes the phone or will drop the phone. But If anyone shakes the
phone mistakenly it will start working which can make unnecessary problems. Similar to this there
is another app named ''Shake to Alert''. This project idea is to develop a system that consist of all
the features in the existing application and develop a new application.
So many times, or in any kind situation user may run out of data pack and cannot use data to use
all the features in a distress situation. Keeping that in mind this project has planned for Offline
mode where the application can send alert message but without location.
This feature has been added for minimizing problems anyhow so that in any situation the user can
get help. Though the application cannot send location with this feature but user‟s family may know
the route of user and can reach out for help or can at least know that she is in danger.
A use case model and a flowchart diagram of the proposed system is given below which will make
it easy to understand all the working methodology of the system.
7. FUTURE ENHANCEMENT
Future studies should also consider whether the accuracy of the model is generalizable to other
contexts. This can be investigated by applying the models to recognize voice and automatic call
and audio services.
This is the “Android Application for women security system” which is very useful
application mainly for girl’s safety. When we feel that we are in emergency situation, for
example travelling alone in the Auto/Cab at night time we can use this application. So that on
one click we can send our location to our family members and to any police stations.
As an independent nation, we must ensure respect and security of women and we cannot deny
them this basic right. It is now time to initiate action to eradicate the menace of security issues
with women. Violence against women remains embedded in our societies, both as a daily reality
and a difficult situation.
Gender justice is impossible in a world where at least one in three women faces violence
in her lifetime, regardless of her culture, religion, socioeconomic class, or education level Our
country can be a true democracy only when all women have the security and freedom from
violence.
9. APPENDICES
Main Activity
package com.vinayak09.wsafety;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.PopupMenu;
import androidx.core.content.ContextCompat;
import android.Manifest;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.google.android.material.snackbar.Snackbar;
import java.util.Map;
import java.util.function.BiConsumer;
@Override
protected void onResume() {
super.onResume();
SharedPreferences sharedPreferences = getSharedPreferences("MySharedPref",MODE_PRIVATE);
String ENUM = sharedPreferences.getString("ENUM","NONE");
if(ENUM.equalsIgnoreCase("NONE")){
startActivity(new Intent(this,RegisterNumberActivity.class));
}else {
TextView textView = findViewById(R.id.textNum);
textView.setText("SOS Will Be Sent To\n"+ENUM);
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
NotificationManager m = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
m.createNotificationChannel(channel);
}
}
snackbar.show();
}
});
if (ContextCompat.checkSelfPermission(this, Manifest.permission.SEND_SMS) ==
PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) ==
PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ) {
Intent notificationIntent = new Intent(this,ServiceMine.class);
notificationIntent.setAction("Start");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
getApplicationContext().startForegroundService(notificationIntent);
Snackbar.make(findViewById(android.R.id.content),"Service Started!",
Snackbar.LENGTH_LONG).show();
}
}else{
multiplePermissions.launch(new
String[]{Manifest.permission.SEND_SMS,Manifest.permission.ACCESS_COARSE_LOCATION,Manif
est.permission.ACCESS_FINE_LOCATION});
}
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(item.getItemId() == R.id.changeNum){
startActivity(new Intent(MainActivity.this,RegisterNumberActivity.class));
}
return true;
}
});
popupMenu.show();
}
}
import androidx.appcompat.app.AppCompatActivity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.google.android.material.textfield.TextInputEditText;
TextInputEditText number;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_number);
number = findViewById(R.id.numberEdit);
}
RegisterNumberActivity.this.finish();
}else {
Toast.makeText(this, "Enter Valid Number!", Toast.LENGTH_SHORT).show();
}
}
}
ServicesMine activity
package com.vinayak09.wsafety;
import android.Manifest;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.IBinder;
import android.telephony.SmsManager;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import com.github.tbouron.shakedetector.library.ShakeDetector;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.tasks.OnSuccessListener;
public class ServiceMine extends Service {
FusedLocationProviderClient fusedLocationClient;
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
fusedLocationClient.getLastLocation()
.addOnSuccessListener(new OnSuccessListener<Location>() {
@Override
public void onSuccess(Location location) {
if (location != null) {
// Logic to handle location object
location.getAltitude();
location.getLongitude();
myLocation =
"http://maps.google.com/maps?q=loc:"+location.getLatitude()+","+location.getLongitude();
}else {
myLocation = "Unable to Find Location :(";
}
}
});
ShakeDetector.create(this, () -> {
SharedPreferences sharedPreferences =
getSharedPreferences("MySharedPref",MODE_PRIVATE);
String ENUM = sharedPreferences.getString("ENUM","NONE");
if(!ENUM.equalsIgnoreCase("NONE")){
manager.sendTextMessage(ENUM,null,"Im in Trouble!\nSending My Location
:\n"+myLocation,null,null);
}
});
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (intent.getAction().equalsIgnoreCase("STOP")) {
if(isRunning) {
this.stopForeground(true);
this.stopSelf();
}
} else {
NotificationManager m = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
m.createNotificationChannel(channel);
}
}
return super.onStartCommand(intent,flags,startId);
@Override
public void onDestroy() {
super.onDestroy();
}
}
Services screen
package com.vinayak09.wsafety;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
new CountDownTimer(1000,500){
@Override
public void onTick(long millisUntilFinished) {
@Override
public void onFinish() {
startActivity(new Intent(SplashScreen.this,MainActivity.class));
SplashScreen.this.finish();
}
}.start();
Tests
package com.vinayak09.wsafety;
import org.junit.Test;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
Example instrument test
package com.vinayak09.wsafety;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.vinayak09.wsafety", appContext.getPackageName());
}
}
Home.xml
Code: activity_home.xml
<Button
activity_setup.xml
AndroidManifest.xml
<uses-permission android:name="android.permission.SEND_SMS"
tools:remove="android:maxSdkVersion" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use Google Maps Android
API v2, but you must specify either coarse or fine location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"
tools:remove="android:maxSdkVersion" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-
permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-
permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity android:name=".LauncherActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to sign the
APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<activity android:name=".AEContactActivity"
android:label="@string/title_activity_aecontact" />
<activity
android:name=".DbActivity" android:label="@string/dblabel" />
<activity android:name=".TrackerActivity"
android:label="@string/title_activity_tracker" />
<activity android:name=".RouteListActivity" />
<activity android:name=".AERouteActivity" />
<receiver android:name=".MyReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SCREEN_OFF" />
<action android:name="android.intent.action.SCREEN_ON" />
</intent-filter>
</receiver>
</application>
</manifest>
APPENDIX – II : SCREENSHOTS
[5] Laird Dornin “Programming Android” second edition "O'Reilly Media, Inc.", 2012.
[6] Ravi Sekhar Yarrabothu and Brama Ambika Thota, “ABHAYA: An Android App for the
Safety of Women”,
[9] M. Mahajan, K. Reddy and M. Rajput, "Design and implementation of a rescue system for
safety of women," 2016 International
[10] Anmol Agarwal, Nitish Kumar Sharma, Piyush Gupta, Prakhar Saxena, Rohit Kumar Pal,
Siddharth Mehrotra, Prof.
[11] Albert Mayan.J, Julian Menezes. R and Breezely George M,"Designing a Customized
Testing Tool for Windows Phones Utilizing
[12] Dhruv Chand, Sunil Nayak “A Mobile Application for Women’s Safety: WoSApp “, IEEE
TENCON 2015 Journal Publication.
[13] Prof.Yadhu naik “Sthree Raksha -an Android app”, International Journal of Recent Trends
in Engineering & Research