You are on page 1of 62

Project Report

On

“Project Rudra”

Submitted in partial fulfilment of the requirement for the award degree


IN

Bachelor of Technology (B.Tech)


IN
Computer Science and Engineering

J.C. BOSE UNIVERSITY OF SCIENCE & TECHNOLOGY


YMCA, FARIDABAD

Submitted To: Submitted By:


Ms. Amita Pathania Akshay Ratra,
Vipul jha

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
DECLARATION

We hereby declare that the project entitled “Project Rudra” submitted to JC Bose
University Of Science and Technology Faridabad, Haryana (India), is a record of an
original work done by us under the guidance of Ms Amita Pathania (Assistant
Professor) in Computer Science and Engineering, ARAVALI COLLEGE OF
ENGINEERING AND MANAGEMENT, FARIDABAD, and this project work
is submitted in the partial fulfillment of requirements for the award of the degree of
Bachelor of Technology in COMPUTER SCIENCE AND ENGINEERING.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
CERTIFICATE

This is to certify that the project titled “Project Rudra” is the bonafide work carried
out by Akshay Ratra, Vipul Jha, students of B.Tech (CSE) of Aravali College of
Engineering and Management, Jasana, Faridabad affiliated to J.C. Bose University
of Science and Technology, during the academic year 2021-22, in partial fulfillment
of the requirements for the award of the degree of Bachelor of Technology
(Computer Science and Engineering ) and that the project has not formed the basis
for the award previously of any other degree, diploma, fellowship or any other
similar title.

Signature of the Guide

Place:

Date:

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
TABLE OF CONTENTS

1. INTRODUCTION
● Brief about project
● Hardware and Software Requirements
2. JAVA
● What is JAVA?
● What is JAVA used for?
● Benefits of JAVA
● Disadvantages of JAVA
● Best Practices for using JAVA
3. XML
● What is XML?
● What is Mark Up Language?
● Why XML?
4. Django Rest Framework
● What is an API
● Why use an API
● Why Django Rest Framework
5. System Analysis and Design
● Frontend
● Backend
● Integration Test
6. Future Scope

7. Conclusion

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Introduction

Brief about project

This project was made by taking the safety of a citizen into consideration and giving
high priority. As we live in a free country everyone has a right to move around
without any fear but this often gets compromised due to inevitable circumstances
and evil social elements.

To reduce this gap of theory practical live we would like to introduce an app that
gives citizens confidence to move feeling without any fear. The purpose of this app
is to give women confidence and provide them safety

Rudra is a safety application to every local citizens. High priority- women safety.

Rudra is a one of the kind application that's role is to safe guard every citizen, high
priority for women. The action is done by alerting the police, blood relation and the
nearby citizens to help the one who was in threat.

There will be providing an Emergency Response Service in the most effective


manner to the public by the police. The Alert messages will reach the police control
room and swift actions will be imminent.

Hardware and Software Requirements

To run it in local server we need a minimum of 8 GB RAM and an SSD would be


recommended. A processor of intel i5 would do the job pretty good.

To run it in an android handset we need minimum 1 GB RAM and maximum 50MB


storage.

For software part we are using XML and Java for frontend part and django rest
framework 3.11 for making APIs.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
JAVA

What is Java?
Java is a general-purpose programming language that is class-based and object-
oriented. The programming language is structured in such a way that developers can
write code anywhere and run it anywhere without worrying about the underlying
computer architecture. It is also referred to as write once, run anywhere (WORA).
This means Java code compiled once can be run on all platforms that run Java
Runtime Environment without the need for recompilation.
Java was developed inside Sun Microsystems (acquired by Oracle) by James
Gosling. It was developed to be similar to C++ and shares a lot of syntax with it.
Java, currently maintained by Oracle, receives regular updates to accommodate the
evolving needs of the developer community.

What is Java Used for?


Java can be used to build applications for a wide range of platforms. Desktops,
servers, mobile phones, tablets, Blu-ray players, televisions, and web browsers all
use Java, and developers can write Java-based applications for any of these
platforms. Since Java adheres to WORA requirements, the same code can be run on
all the platforms having Java Runtime Environment (JRE) without recompiling the
code.
Java is used to write applications for different platforms that run JRE and supports
applications that run on a single device like a desktop or mobile phone. Java can also
be used to develop applications that work in a distributed manner. That means the
same application can be distributed between servers or clients in a network and can
be executed synchronously. Java can also be used to write application modules or
applets as part of web pages.
Java is used for:
● GUI applications
● Web servers and applications servers

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
● Middleware applications
● Web applications
● Mobile applications
● Embedded systems
● Enterprise applications

Benefits of Java
Java has evolved over the years as Oracle maintains the language and provides
updates regularly. The support from the huge developer community is a definite
advantage for new Java programmers, as well. Having been around for more than
two decades, Java has a substantial collection of available open-source libraries and
functions. Here’s a look at some of the key benefits of the Java programming
language.
● Simple and easy to learn. Java shares syntax with C and C++. Explicit
pointers, operator overloading, storage classes, and other elements that are
present in C++ are not available in Java. This makes it a less complex language
for writing code.
● Object-oriented programming language. Everything in Java is treated as an
object and has accompanying features like class, encapsulation, abstraction,
inheritance, and polymorphism.
● Multithreading is supported by Java. Large applications can be converted to
multiple threads and executed simultaneously. This reduces the resources and
time needed to execute a program.
● Platform agnostic language. Since Java runs within its virtual machine
sandbox, the platform and its computer architecture need not be considered
while writing Java applications. The same code can be executed by different
platforms without recompiling for each device, making project management
easy.
● Secure platform. Java programs are executed within its runtime environments.
It also provides a classloader to load classes to the runtime environment. This
provides a buffer and is inherently secure. That said, Java browser plugins are
extremely insecure and are better deactivated as most of the web now runs on
JavaScript.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Disadvantages of Java
While there are many advantages to using Java, it’s not free of downsides or room
for improvement. Some of the disadvantages are:
1. Applications must be run on JRE. Java sandbox makes the applications
platform agnostic, but this also means that applications can be run only on top
of JRE, which requires more resources. Memory consumption is high as
applications have to run on top of a Java virtual machine.
2. UIs built using Java are less attractive. There are multiple Java frameworks to
create UIs for applications, but none of them are advanced enough to handle
complex UI elements that can be easily achieved by programming languages
such as JavaScript.
3. No backup facility. Java provides no backup facility and works from storage.
4. Garbage collectors provided with Java are automatic. That may seem like an
advantage, but it does not provide any facility for programmers to control
garbage collection. This is a problem when advanced functionalities are coded
in Java.

Best Practices for Using Java


Though Java is very secure, the Java browser plugin is extremely insecure and has
been the reason for cybersecurity incidents in the past. It is best to disable the plugin
even though you are using JRE. Here are some additional best practices to follow
while using Java.
● Code in a safe environment.
● Plan object requirements before writing code.
● Follow naming conventions. This makes it easy to read for other programmers
in the project.
● Avoid the potential for memory leaks.
● Avoid empty catch blocks.
● Avoid using loops with indexes.
● Reserve sufficient memory as Java is a memory hog.
● Prematurely check Nulls to avoid Null pointer exceptions.
● JSON must be used to encode with Java, and schema must be known prior to
decoding.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
● Re-scale images to use less resources. Buffer the original image and use the
re-scaled one.
Java is a popular programming language that is easy to learn, platform agnostic, and
can be used for a wide range of devices. Oracle provides excellent support for Java,
and the large and growing base of Java programmers also makes it an appealing
language to lean and code with.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
XML

What is xml
● XML (eXtensible Markup Language) is a markup language.
● XML is designed to store and transport data.
● XML was released in late 90’s. it was created to provide an easy to use and
store self describing data.
● XML became a W3C Recommendation on February 10, 1998.
● XML is not a replacement for HTML.
● XML is designed to be self-descriptive.
● XML is designed to carry data, not to display data.
● XML tags are not predefined. You must define your own tags.
● XML is platform independent and language independent.
Note: Self-describing data is the data that describes both its content and structure.

What is mark-up language


A markup language is a modern system for highlight or underline a document.
Students often underline or highlight a passage to revise easily, same in the sense of
modern markup language highlighting or underlining is replaced by tags.

Prerequisite
Before you start to learn xml, you should know basic of HTML & JavaScript.

Why xml?
Platform Independent and Language Independent: The main benefit of xml is that
you can use it to take data from a program like Microsoft SQL, convert it into XML
then share that XML with other programs and platforms. You can communicate
between two platforms which are generally very difficult.
The main thing which makes XML truly powerful is its international acceptance.
Many corporation use XML interfaces for databases, programming, office
application mobile phones and more. It is due to its platform independent feature.

Django Rest Framework

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
What is an API?
Django Rest Framework lets you create RESTful APIs: A way to transfer
information between an interface and a database in a simple way.
It separates user interface and data storage and communicates user and database
sending a .json file. Just like this one:

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT
FARIDABAD, HARYANA

AUGUST-2022
Why use an API?
You can’t understand what an API is unless you understand what it can do. Imagine
that you want to create a web application. Obviously, you would choose Django.
You create it and it’s a hit! Everybody loves your web application! They love it so
much, that they want a mobile phone version! Time to create an Android Version!
And an iOS version. And then you have to replicate 2 times the same code to Add,
View, Remove, Update and Delete data, with different languages. That opens the
door to many possible mistakes…
But despite that, let’s say you managed and created the same application, using 3
different languages. Now, you notice that your website is static. You want your web
app to be more dynamic and modern. You need Javascript for that. While, you can
do it with just Vanilla Javascript, it is better to use a JS framework as React or Vue.
Now you need to re-do what you did in Django, iOS and Android again or you can
create a REST API.
With DRF, you can create an API to serve information to the user’s interface.
You can create a FrontEnd with Vue, an Android and iOS application, and all three
different platforms are connected to the same API

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
You only need to create the logic once, and each of your platforms connect to the
same API.
This way, if you want to update it or add more functionality, you only need to change
in one side, not on each platform.
It is easier this way, right? Easier, more scalable and more reliable.
DRF takes the heavyweight of the database interaction and logic to just serve you
the information. No matter how many platforms you use or the language they are
built. As simple as that.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Why Django Rest Framework?

We know now that REST APIs are important because they let us interact in an easy
way with the database and we can use it with different platforms.
But why use Django Rest Framework and not Node.js, Golang, Rust, etc?
Well, for starters, DRF uses Python, an easy to learn language.
DRF, as much as Django, makes everything simple and easier. Do you know Django
views? You have them in DRF too!
Do you want an end-point (an HTTP address) that returns you a list with each user,
with all of their fields and another one to create new users? Cool, here’s the code:
class UserList(generics.ListCreateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
That’s it. You create a class called UserList that inherits methods from
ListCreateAPIView.
As the name says, you can List and Create users. If you ask for the URL (GET), you
get the list of the users, if you send (POST) information to that URL it will create a
new user.
3 lines of code. That’s all you need.
Another great thing about DRF? documentation. Alongside with Scrapy, it has the
best docs I have seen for a Django Framework. There are more technical things like
how migrations are handled, how each object has a model, how easy to switch
databases is and more.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Existing System:

As there are numerous apps on women safety but they cover only one aspect and are
often paid.

Proposed System:

An app that is built on the top of it’s predecessor rather then from ground up. It
includes features of the existing apps with new add once.

Following are some reasons for why this app is made and why it gives a good
competition to its counter-parts if not beat them:

1. It has customizable UI which caters to the need of the user.

2. It gives information about nearest police station and other emergency


services which can be very helpful in undesirable circumstances

3. It gives an SOS call to your close contact which again can be very handy if one
don’t have the time to call someone for help or to tell their condition.

4. It gives the user freedom to do their duties as they have something which can
reach out to them before anyone and help them.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
SYSTEM ANALYSIS & DESIGN

Requirement Specification:

1. A team of atleast 3 members for frontend, backend and coordination and


miscellaneous tasks.
2. To run locally, a computer with minimum of 8 GB ram, intel i5 processor and a
GPU would be an overkill.
3. For deployment we can use heroku but cloud providers like AWS is preferred.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT
FARIDABAD, HARYANA

AUGUST-2022
Frontend

Testing of frontend is pretty intuitive. If it looks good and work as


intended it has passed the test.
To test the frontend of our app we use all its functionalities and buttons
and check whether it is working or not. If it works as it was supposed to
work it has passed the test If not work is needed to be done.

Backend

For our backend part we have several APIs to test. We can use postman
to test our APIs

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Integration Test:
It is done to check how the backend and frontend behaves when
integrated. First we combine and sync our two components snd run our
fully app. If it work as intended then it has passed the test if not then either
there is problem in the components or they are not synced or properly
integrated.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
UI screenshots :

Register Screen

Login Screen

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Home Screen

Add SOS
Contacts

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Emergency Numbers

Trigger Screen

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Code :
Xml :-
1. Register Page
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
tools:context=".Registration">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp">

<ImageView

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_width="800dp"
android:layout_height="90dp"
android:src="@drawable/logo"></ImageView>

<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="120dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:gravity="center_horizontal"
android:text="WELCOME"
android:textSize="35sp" />

</RelativeLayout>

<TextView

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:gravity="center_horizontal"
android:text="Register Here"
android:textSize="20sp" />

<EditText
android:id="@+id/fullName"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="45dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:ems="10"
android:gravity="center_horizontal"
android:hint="Full Name"
android:inputType="textPersonName" />

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"
android:hint="Email"
android:inputType="textEmailAddress" />

<EditText
android:id="@+id/phone"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"
android:hint="Phone Number"
android:inputType="phone" />

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:ems="10"
android:gravity="center_horizontal"
android:hint="Password"
android:inputType="textPassword" />

<Button
android:id="@+id/registerbtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="120dp"
android:layout_marginTop="21dp"
android:layout_marginRight="120dp"
android:layout_marginBottom="3dp"
android:background="@color/colorPrimaryDark"
android:text="Register"
android:textColor="#FFFFFF"
android:textSize="24sp" />

<TextView
android:id="@+id/createText"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="3dp"
android:textColor="@color/colorPrimaryDark"
android:gravity="center_horizontal"
android:text="Already registered? Login Here"
android:textSize="18sp" />

<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible" />

</LinearLayout>

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
2. Login page
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/background"
tools:context=".Registration">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp">

<ImageView
android:layout_width="800dp"
android:layout_height="90dp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:src="@drawable/logo"></ImageView>

<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="120dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:textColor="#FFFFFF"
android:textStyle="bold|italic"
android:gravity="center_horizontal"
android:text="WELCOME"
android:textSize="35sp" />

</RelativeLayout>

<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
android:gravity="center_horizontal"
android:text="Register Here"
android:textSize="20sp" />

<EditText
android:id="@+id/fullName"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="45dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:hint="Full Name"
android:inputType="textPersonName" />

<EditText
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"
android:hint="Email"
android:inputType="textEmailAddress" />

<EditText
android:id="@+id/phone"
android:layout_width="match_parent"
android:layout_height="37dp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"
android:hint="Phone Number"
android:inputType="phone" />

<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="25dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="3dp"
android:background="@android:color/background_light"
android:ems="10"
android:gravity="center_horizontal"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:hint="Password"
android:inputType="textPassword" />

<Button
android:id="@+id/registerbtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="120dp"
android:layout_marginTop="21dp"
android:layout_marginRight="120dp"
android:layout_marginBottom="3dp"
android:background="@color/colorPrimaryDark"
android:text="Register"
android:textColor="#FFFFFF"
android:textSize="24sp" />

<TextView
android:id="@+id/createText"
android:layout_width="match_parent"
android:layout_height="wrap_content"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="3dp"
android:textColor="@color/colorPrimaryDark"
android:gravity="center_horizontal"
android:text="Already registered? Login Here"
android:textSize="18sp" />

<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="invisible" />

</LinearLayout>

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
3. Home Screen
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
tools:context=".MainScreen">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp">

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
<ImageView
android:layout_width="800dp"
android:layout_height="90dp"
android:src="@drawable/logo">
</ImageView>
</RelativeLayout>

<GridLayout
android:layout_marginTop="10dp"
android:columnCount="2"
android:rowCount="3"
android:columnOrderPreserved="false"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
android:layout_margin="12dp"
>

<LinearLayout
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/myprofile">
</ImageView>

<TextView
android:layout_marginTop="12dp"
android:textColor="@color/black"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:textSize="18sp"
android:text="My Profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
android:layout_margin="12dp"
>

<LinearLayout
android:orientation="vertical"
android:padding="16dp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/relative">
</ImageView>

<TextView
android:layout_marginTop="12dp"
android:textColor="@color/black"
android:textSize="18sp"
android:text="Add Relative"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</androidx.cardview.widget.CardView>

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
//2

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
android:layout_margin="12dp"
>

<LinearLayout
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<ImageView
android:layout_width="80dp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:layout_height="80dp"
android:src="@drawable/helpline">
</ImageView>

<TextView
android:layout_marginTop="12dp"
android:textColor="@color/black"
android:textSize="18sp"
android:text="Helpline Numbers"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
app:cardElevation="6dp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
app:cardCornerRadius="12dp"
android:layout_margin="12dp"
>

<LinearLayout
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/triggers">
</ImageView>

<TextView
android:layout_marginTop="12dp"
android:textColor="@color/black"
android:textSize="18sp"

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:text="Triggers"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</androidx.cardview.widget.CardView>

//3

<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_columnWeight="1"
android:layout_rowWeight="1"
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
android:layout_margin="12dp"
>

<LinearLayout

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="@drawable/developedby">
</ImageView>

<TextView
android:layout_marginTop="12dp"
android:textColor="@color/black"
android:textSize="18sp"
android:text="Developed By"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
</androidx.cardview.widget.CardView>
</GridLayout>
</LinearLayout>
</ScrollView>

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Java Code :-
1. Registration
package com.dan.rudra;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
public class Registration extends AppCompatActivity {
EditText mFullName,mEmail,mPassword,mPhone;
Button mRegisterbtn;
TextView mCreateText;
FirebaseAuth fAuth;
ProgressBar progressBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_registration);

mFullName = findViewById(R.id.fullName);
mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
mPhone = findViewById(R.id.phone);
mRegisterbtn = findViewById(R.id.registerbtn);
mCreateText = findViewById(R.id.createText);

fAuth = FirebaseAuth.getInstance();

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
progressBar = findViewById(R.id.progressBar);

if (fAuth.getCurrentUser() != null) {
startActivity(new Intent(getApplicationContext(),
MainActivity.class));
finish();
}

mRegisterbtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String email = mEmail.getText().toString().trim();
String password = mPassword.getText().toString().trim();
if (TextUtils.isEmpty(email)) {
mEmail.setError("Email is Required.");
return;

if (TextUtils.isEmpty(password)) {
mPassword.setError("Password is Required");

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
return;

}
if(password.length() < 6) {
mPassword.setError("Password Must be >= 6 Characters");
return;
}
progressBar.setVisibility(View.VISIBLE);

fAuth.createUserWithEmailAndPassword(email,password).addOnComp
leteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task)
{
if (task.isSuccessful()) {
Toast.makeText(Registration.this, "User Created.",
Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(),
MainActivity.class));

} else {
Toast.makeText(Registration.this, "Error" +
task.getException().getMessage(), Toast.LENGTH_SHORT).show();

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
progressBar.setVisibility(View.GONE);
}
}
});

}
});

mCreateText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),
Login.class));
}
});

}
}

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
2. Login
package com.dan.rudra;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;

public class Login extends AppCompatActivity {

EditText mEmail,mPassword;
Button mLoginBtn;
TextView mCreateBtn;
// FirebaseAuth fAuth;

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
ProgressBar progressBar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
mLoginBtn = findViewById(R.id.loginBtn);
mCreateBtn = findViewById(R.id.createText);
//fAuth = FirebaseAuth.getInstance();

progressBar = findViewById(R.id.progressBar);

mLoginBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),
MainActivity.class));

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
String email = mEmail.getText().toString().trim();
String password = mPassword.getText().toString().trim();
if (TextUtils.isEmpty(email)) {
mEmail.setError("Email is Required.");
return;

if (TextUtils.isEmpty(password)) {
mPassword.setError("Password is Required");
return;

}
if(password.length() < 6) {
mPassword.setError("Password Must be >= 6 Characters");
return;
}
progressBar.setVisibility(View.VISIBLE);

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
//
fAuth.signInWithEmailAndPassword(email,password).addOnComplete
Listener(new OnCompleteListener<AuthResult>() {
// @Override
// public void onComplete(@NonNull Task<AuthResult>
task) {
// if(task.isSuccessful()) {
// Toast.makeText(Login.this, "Logged in Successfully",
Toast.LENGTH_SHORT).show();
//
// startActivity(new Intent(getApplicationContext(),
MainActivity.class));
//
//
// } else {
// Toast.makeText(Login.this, "Error! " +
task.getException().getMessage(),Toast.LENGTH_SHORT).show();
// }
// }
// });

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
}

});
mCreateBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(),
Registration.class));
}
});
}
}

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
3. HomePage
package com.dan.rudra;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class MainScreen extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_screen);
}
}

Output:
The app work as intended and it is a successful project.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Future Scope

We will try to improve this app by adding voice messages and AI voice recognition
so that in case of emergency AI will recognize the voice and according to that it will
show you the emergency numbers according to your situation.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
Conclusion

This app work as we wanted it to be and it is made as a successor rather


than a competitor of existing women safety app. But still it has a lot of
room to improve and in future we can improve it better with a vision to
ensure safety of women.

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022
References

● www.stackoverflow.com
● www.geekforgeeks.org
● www.javapoint.com

ARAVALI COLLEGE OF ENGINEERING AND MANAGEMENT


FARIDABAD, HARYANA

AUGUST-2022

You might also like