0% found this document useful (0 votes)
34 views60 pages

Project Report - Template

The document is a project report for developing a women's safety app. It includes an introduction describing the purpose and problems addressed by the app, a feasibility study analyzing the technical, economic, and operational feasibility, and sections covering system analysis and design, hardware and software specifications, implementation, and concepts used in developing the Android app like layouts and events.

Uploaded by

diwakar patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views60 pages

Project Report - Template

The document is a project report for developing a women's safety app. It includes an introduction describing the purpose and problems addressed by the app, a feasibility study analyzing the technical, economic, and operational feasibility, and sections covering system analysis and design, hardware and software specifications, implementation, and concepts used in developing the Android app like layouts and events.

Uploaded by

diwakar patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 60

Project Report on

{Title}
A Project Report
Submitted in partial fulfillment for the award of the degree
of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
by

Name : XXXXXX
Roll No:XXXX

Under The Supervision of


Mr. Ajmer Singh (Details of your incharge at internship
organization)
(Assistant Professor, CSED)

( Insert Logo of your company here)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


Deenbandhu Chhotu Ram University of Science and Technology,
Murthal, Sonepat-131039
2022
i
DECLARATION

I hereby declare that the project entitled “WOMEN SAFETY APP” submitted by
me in partial fulfillment of the requirement for the award of BACHELOR OF
TECHNOLOGY Degree in COMPUTER SCIENCE AND ENGINEERING,
comprises our original work and due references have been made in text to all other
material used.

Signature of the Students:

Himanshu Kathpalia (14001001021)

Place: DCRUST, Murthal


Date:

ii
CERTIFICATE

This is to certify that the project entitled “WOMEN SAFETY APP” is the
bonafide work carried out by Himanshu Kathpalia(14001001021) who is a
student of B. Tech, DCRUST, Murthal, during the year 2017 , in partial fulfillment
of the requirements for the award of the Degree of Bachelor of Technology and
that the project has not formed the basis for the award of any degree earlier.

Signature of the Guide: Signature of training/internship


incharge
Name: Name:
Designation Designation

Place: DCRUST, Murthal


Date:
ABSTRACT

The purpose of the project is to to ensure the safety of women while travelling because today
the safety of women has become a serious issue in our society. This app basically allows the
women to send the danger message to the desired phone number. As soon as the women will
press the emergency button not only the message will be sent but also phone call will be
automatically made to the police number.The project basically has following modules.
1. Login Page
2. Complaint Tab
3. Filing An FIR.
4. Filing a complaint to an N.G.O.
5. Sending Safety Form
6. Camera

The app is both online as well as offline as some features uses internet access while others can
be used offline also.

iv
ACKNOWLEDGEMENTS

Acknowledgement is the perfect way to convey heartiest thanks to all


outstanding personalities. I consider myself fortunate to get the opportunity of
doing a project, yet the opportunity could not have been utilized without the
guidance and support of many individuals.
I register my immense gratitude to project guide Mr.Ajmer Singh (CSE Dept.),
DCRUST.

I am highly indebted to “Mr.Ajmer Singh ” for giving me a rare opportunity to


undertake this project.
I also extend my immense gratitude to “Mr. Parvinder Singh”(Head of Computer
Science Dept) for his kind help and support .

Finally, I would be failing to my duty if I did not put on record my deep sense
of obligation to my parents and friends, who provided me an environment
conducive to hardwork.
v
Table of contents
Title Page
Declaration of the Student
Certificate of the Guide
Abstract
Acknowledgement

CHAPTER NO. TITLE

Chapter 1. INTRODUCTION
1.1 Project Overview
1.2 Problem Statement
1.3 Feasibility Study
1.4 Feasibility Report

Chapter 2. SYSTEM ANALYSIS AND DESIGN


2.1 System Analysis
2.1.1 Existing System
2.1.2 Proposed System
2.2 Requirement analysis

Chapter 3. HARDWARE AND SOFTWARE SPECIFICATION


3.1 Hardware Specification
3.2 Software Specification

Chapter 4. IMPLEMENTATION / CODING


4.1 Android Studio
4.2 Java Development Kit
4.3 Java(Programming Language)
4.3.1 Performance
4.3.2 Automated Memory Management
Chapter 5 CONCEPTS OF ANDROID
5.1 Layout
5.1.1 Basics of Layout
5.1.2 Types of Layout
6.1.3 Attributes of Layout
5.2 EVENTS
5.2.1 Basics of Events
5.2.2 Event Listeners and attributes

5.3 Camera and its detailed description


5.4 SMS Manager and its detailed description

Chapter 6. CONTROL FLOW DIAGRAMS


6.1 Control Flow Diagram of login page
6.2 Control Flow Diagram of complain tab
6.3 Control Flow Diagram of safety tab
6.4 Control Flow Diagram of camera tab

Chapter 7. About Project


7.1 Functioning of full project
7.2 Limitations
7.3 References
1.1. Project Overview

The main objective of the project is to develop an android application which could make women
feel safe while traveling . The project provides an easy way to handle all things .While travelling
the women can fill the safety form in advance and as soon as she feels there is a danger she could
press the danger button .It will not only send the sms at the desired phone number but would also
be able to make a call to women helpline number automatically. So during danger it helps a lot.
1.2. Problem Statement

Problem statement is one of the basic and important phases of project phase. When the basic
problem is determined, it is documented and the symptomatic problem is analyzed, then the
current list of basic problem is completed. A system is simply a set of components that interact to
accomplish some purpose.

This project aims at providing the facilities to the user to be safe in an easy and efficient manner
with multiple tabs. This application can be used for the benefit of user by saving a lot of lives by
not directly interacting with the users and insteadinforming to relatives and police.

Major problems faced by users are:

 All apps are generally online so at time there is no internet connection it creates problem.

Therefore, by facing all these problems we personally feel that there is a need of awomen safety
app to save the precious time and resources.

1.3. Feasibility Study

All projects are feasible given unlimited resources and infinite time. But the development of
software is plagued by the scarcity of resources and difficult delivery rates. It is both necessary
and prudent to evaluate the feasibility of a project at the earliest possible time.

Three key considerations are involved in the feasibility analysis.

Economic Feasibility:

This procedure is to determine the benefits and savings that are expected from a candidate
system and compare them with costs. If benefits outweigh costs, then the decision is made to
design and implement the system. Otherwise, further justification or alterations in proposed
system will have to be made if it is to have a chance of being approved. This is an ongoing effort
that improves in accuracy at each phase of the system life cycle.
Technical Feasibility:

Technical feasibility centers on the existing computer system (hardware, software, etc.,) and to
what extent it can support the proposed addition. If the budget is a serious constraint, then the
project is judged not feasible.

Operational Feasibility:

People are inherently resistant to change, and computers have been known to facilitate change.

1.4. Feasibility Report

1. Technical feasibility:

The system is self-explanatory and does not need any extra sophisticated training to learnto handle
women safety app. As the system has been built by concentrating on the User ease to understand
Concepts, the application can also be handled very easily with a novice User. The overall time that
is required to train the users upon the system is less than half an hour.

The System has been added with features of online complaints and button interaction methods,
which makes the user the master as he starts working through the environment.

2. Financial Feasibility:

 Time Based: It requires time to build this app but since it is going to benefit a lot of
users so it does not matters much.

 Cost Based: No special investment need to manage the app. Investment requires only
once at the time of preparation. The software used in this project is freeware so the cost
of developing the tool is minimal and hence the overall cost.
2. System Analysis and Design

2.1. System Analysis

System Analysis is first stage according to System Development Life Cycle model. This System
Analysis is a process that starts with the analyst.

Analysis is a detailed study of the various operations performed by a system and their
relationships within and outside of the system. One aspect of analysis is defining the boundaries
of the system and determining whether or not a candidate system should consider other related
systems. During analysis, data are collected on the available files, decision points, and
transactions handled by the present system.

Logical system models tools that are used in analysis. Training, experience, and common sense
are required for collection of the information needed to do the analysis.

2.1.1. Existing System:

The existing system is Online .The limitations are:

 Without Internet Connection app will not work.

 No Complaint Center was there Works

 Moreover the app don’t keeps the record of what you do.

 Works only online

2.1.2. Proposed System:

 The women safety app will work online as well as offline

 To have access to more than one tabs.


 This system has made complaint centre also available in same app

 It avoids unnecessary website opening time.

2.2. Requirement Analysis:

Requirement Analysis is a software engineering task that bridges the gap between system level
software allocation and software design. It provides the system engineer to specify software
function and performance, indicate software’s interface with the other system elements and
establish constraints that software must meet.

The basic aim of this stage is to obtain a clear picture of the needs and requirements of the end-
user and also the organization. Analysis involves interaction between the clients and the analysis.
Usually analysts research a problem by asking questions and reading existing documents. The
analysts have to uncover the real needs of the user even if they don’t know them clearly. During
analysis it is essential that a complete and consistent set of specifications emerge for the system.
Here it is essential to resolve the contradictions that could emerge from information got from
various parties. This is essential to ensure that the final specifications are consistent.

It may be divided into 5 areas of effort.

 Problem recognition
 Evaluation and synthesis
 Modeling
 Specification
 Review
Each Requirement analysis method has a unique point of view. However all analysis
methods are related by a set of operational principles.

They are

 The information domain of the problem must be represented and understood.


 The functions that the software is to perform must be defined.
 The behavior of the software as a consequence of external events must be defined.
 The models that depict information, function and behavior must be partitioned in
a hierarchical or layered fashion.
 The analysis process must move from essential information to Implementation
detail
3. Hardware and Software Specifications

3.1. Hardware Specification:

1. C.P.U :Pentium iii or above

2. Memory : 2 GB RAM

3. Monitor : Mono/Color

4. Keyboard :Low profile, dispatch able type

5. I/O parts : a) Mouse

b) Monitor

6. Operating system :Windows Vista or above

3.2. Software Specification:

1. Front end : Android Studio

2. Development Environment : Java

3. Layout : Xml
3. Implementation / Coding
ANDROID STUDIO
Android Studio is the official IDE for android application development.It
works based on IntelliJ IDEA, You can download the latest version of
android studio from Android Studio 2.2 Download, If you are new to
installing Android Studio on windows,you will find a file, which is named
as android-studio-bundle-143.3101438-windows.exe.So just download and
run on windows machine according to android studio wizard guideline.

If you are installing Android Studio on Mac or Linux, You can download the
latest version from Android Studio Mac Download,or Android Studio Linux
Download, check the instructions provided along with the downloaded file
for Mac OS and Linux. This tutorial will consider that you are going to setup
your environment on Windows machine having Windows 8.1 operating
system.

Installation
So let's launch Android Studio.exe,Make sure before launch Android Studio,
Our Machine should required installed Java JDK. To install Java JDK,take a
references of Android environment setup
Once you launched Android Studio, its time to mention JDK7 path or later
version in android studio installer.

Below the image initiating JDK to android SDK


Need to check the components, which are required to create applications,
below the image has selected Android Studio, Android SDK, Android
Virtual Machine and performance(Intel chip).

Need to specify the location of local machine path for Android studio and
Android SDK, below the image has taken default location of windows 8.1
x64 bit architecture.
Need to specify the ram space for Android emulator by default it would take
512MB of local machine RAM.

At final stage, it would extract SDK packages into our local machine, it
would take a while time to finish the task and would take 2626MB of Hard
disk space.
4.
5. After done all above steps perfectly, you must get finish button and it
gonna be open android studio project with Welcome to android studio
message as shown below
You can start your application development by calling start a new android
studio project. in a new installation frame should ask Application name,
package information and location of the project.
After entered application name, it going to be called select the form factors
your application runs on, here need to specify Minimum SDK, in our tutorial,
I have declared as API23: Android 6.0(Mashmallow)
The next level of installation should contain selecting the activity to mobile,
it specifies the default layout for Applications

At the final stage it going to be open development tool to write the


application code.

Create Android Virtual Device


To test your Android applications, you will need a virtual Android device. So
before we start writing our code, let us create an Android virtual device.
Launch Android AVD Manager Clicking AVD_Manager icon as shown below
After Click on a virtual device icon, it going to be shown by default virtual
devices which are present on your SDK, or else need to create a virtual
device by clicking Create new Virtual device button

If your AVD is created successfully it means your environment is ready for


Android application development. If you like, you can close this window
using top-right cross button. Better you re-start your machine and once you
are done with this last step, you are ready to proceed for your first Android
example but before that we will see few more important concepts related to
Android Application Development.
JDK

The Java Development Kit (JDK) is an implementation of either one of the Java Platform,
Standard Edition; Java Platform, Enterprise Edition or Java Platform, Micro Edition platforms
released by Oracle Corporation in the form of a binary product aimed at Java developers on
Solaris, Linux, macOS or Windows. The JDK includes a private JVM and a few other resources
to finish the development of a Java Application. Since the introduction of the Java platform, it
has been by far the most widely used Software Development Kit (SDK). On 17 November 2006,
Sun announced that they would release it under the GNU General Public License (GPL), thus
making it free software. This happened in large part on 8 May 2007, when Sun contributed the
source code to the OpenJDK.

The JDK has as its primary components a collection of programming tools, including:

 appletviewer – this tool can be used to run and debug Java applets without a web browser
 extcheck – a utility that detects JAR file conflicts
 idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java
IDL file.
 jabswitch – the Java Access Bridge. Exposes assistive technologies on Microsoft
Windows systems.
 java – the loader for Java applications. This tool is an interpreter and can interpret the
class files generated by the javac compiler. Now a single launcher is used for both
development and deployment. The old deployment launcher, jre, no longer comes with
Sun JDK, and instead it has been replaced by this new java loader.
 javac – the Java compiler, which converts source code into Java bytecode
 javadoc – the documentation generator, which automatically generates documentation
from source code comments
 jar – the archiver, which packages related class libraries into a single JAR file. This tool
also helps manage JAR files.
 javafxpackager – tool to package and sign JavaFX applications
 jarsigner – the jar signing and verification tool
 javah – the C header and stub generator, used to write native methods
 javap – the class file disassembler
 javaws – the Java Web Start launcher for JNLP applications
 4.3. Java (programming language)

Java is a general-purpose computer programming language that is concurrent, class-based,


object-oriented, and specifically designed to have as few implementation dependencies as
possible. It is intended to let application developers "write once, run anywhere" (WORA),
meaning that compiled Java code can run on all platforms that support Java without the need for
recompilation. Java applications are typically compiled to bytecode that can run on any Java
virtual machine (JVM) regardless of computer architecture. As of 2016, Java is one of the most
popular programming languages in use, particularly for client-server web applications, with a
reported 9 million developers. Java was originally developed by James Gosling at Sun
Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a
core component of Sun Microsystems' Java platform. The language derives much of its syntax
from C and C++, but it has fewer low-level facilities than either of them.
The original and reference implementation Java compilers, virtual machines, and class libraries
were originally released by Sun under proprietary licences. As of May 2007, in compliance with
the specifications of the Java Community Process, Sun relicensed most of its Java technologies
under the GNU General Public License. Others have also developed alternative implementations
of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU
Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).

The latest version is Java 8 Update 121 which is the only version currently supported for free by
Oracle, although earlier versions are supported both by Oracle and other companies on a
commercial basis.

4.3.1. Performance

Programs written in Java have a reputation for being slower and requiring more memory than
those written in C++. However, Java programs' execution speed improved significantly with the
introduction of just-in-time compilation in 1997/1998 for Java 1.1, the addition of language
features supporting better code analysis (such as inner classes, the StringBuilder class, optional
assertions, etc.), and optimizations in the Java virtual machine, such as HotSpot becoming the
default for Sun's JVM in 2000. With Java 1.5, the performance was improved with the addition
of the java.util.concurrent package, including Lock free implementations of the ConcurrentMaps
and other multi-core collections, and it was improved further Java 1.6.
Some platforms offer direct hardware support for Java; there are microcontrollers that can run
Java in hardware instead of a software Java virtual machine, and some ARM based processors
could have hardware support for executing Java bytecode through their Jazelle option, though
support has mostly been dropped in current implementations of ARM.

4.3.2. Automatic memory management

Java uses an automatic garbage collector to manage memory in the object lifecycle. The
programmer determines when objects are created, and the Java runtime is responsible for
recovering the memory once objects are no longer in use. Once no references to an object
remain, the unreachable memory becomes eligible to be freed automatically by the garbage
collector. Something similar to a memory leak may still occur if a programmer's code holds a
reference to an object that is no longer needed, typically when objects that are no longer needed
are stored in containers that are still in use. If methods for a nonexistent object are called, a "null
pointer exception" is thrown.

One of the ideas behind Java's automatic memory management model is that programmers can
be spared the burden of having to perform manual memory management. In some languages,
memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and
deallocated from the heap. In the latter case the responsibility of managing memory resides with
the programmer. If the program does not deallocate an object, a memory leak occurs. If the
program attempts to access or deallocate memory that has already been deallocated, the result is
undefined and difficult to predict, and the program is likely to become unstable and/or crash.
This can be partially remedied by the use of smart pointers, but these add overhead and
complexity. Note that garbage collection does not prevent "logical" memory leaks, i.e., those
where the memory is still referenced but never used.

Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is
guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new
object; this can cause a program to stall momentarily. Explicit memory management is not
possible in Java.
Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned
integers (usually long integers) can be used interchangeably. This allows the garbage collector to
relocate referenced objects and ensures type safety and security.

As in C++ and some other object-oriented languages, variables of Java's primitive data types are
either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap,
as is commonly true for non-primitive data types (but see escape analysis). This was a conscious
decision by Java's designers for performance reasons.

Java contains multiple types of garbage collectors. By default HotSpot uses the parallel scavenge
garbage collector. However, there are also several other garbage collectors that can be used to
manage the heap. For 90% of applications in Java, the Concurrent Mark-Sweep (CMS) garbage
collector is sufficient. Oracle aims to replace CMS with the Garbage-First collector (G1).

4.3.3. Syntax

The syntax of Java is largely influenced by C++. Unlike C++, which combines the syntax for
structured, generic, and object-oriented programming, Java was built almost exclusively as an
object-oriented language. All code is written inside classes, and every data item is an object, with
the exception of the primitive data types, (i.e. integers, floating-point numbers, boolean values,
and characters), which are not objects for performance reasons. Java reuses some popular aspects
of C++ (such as printf() method).

Unlike C++, Java does not support operator overloading or multiple inheritance for classes,
[49]
though multiple inheritance is supported for interfaces. This simplifies the language and aids
in preventing potential errors and anti-pattern design.

Java uses comments similar to those of C++. There are three different styles of comments: a
single line style marked with two slashes (//), a multiple line style opened with /* and closed with
*/, and the Javadoc commenting style opened with /** and closed with */. The Javadoc style of
commenting allows the user to run the Javadoc executable to create documentation for the
program, and can be read by some integrated development environments (IDEs) such as Eclipse
to allow developers to access documentation within the IDE.

14
Concepts of Android

The basic building block for user interface is a View object which is created from the View
class and occupies a rectangular area on the screen and is responsible for drawing and event
handling. View is the base class for widgets, which are used to create interactive UI components
like buttons, text fields, etc.

The ViewGroup is a subclass of View and provides invisible container that hold other Views or
other ViewGroups and define their layout properties.

At third level we have different layouts which are subclasses of ViewGroup class and a typical
layout defines the visual structure for an Android user interface and can be created either at run
time using View/ViewGroupobjects or you can declare your layout using simple XML
file main_layout.xml which is located in the res/layout folder of your project.

LAYOUT PARAMS
Android Layout Types
There are number of Layouts provided by Android which you will use in almost all the Android
applications to provide different view, look and feel.

Sr.No Layout & Description

1 Linear Layout

LinearLayout is a view group that aligns all children in a single direction, vertically or
horizontally.

2 Relative Layout
RelativeLayout is a view group that displays child views in relative positions.

3 Table Layout
TableLayout is a view that groups views into rows and columns.

4 Absolute Layout
AbsoluteLayout enables you to specify the exact location of its children.

5 Frame Layout
The FrameLayout is a placeholder on screen that you can use to display a single view.

6 List View
ListView is a view group that displays a list of scrollable items.

7 Grid View
GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid.
Layout Attributes
Each layout has a set of attributes which define the visual properties of that layout. There are
few common attributes among all the layouts and their are other attributes which are specific to
that layout. Following are common attributes and will be applied to all the layouts:

Sr.No Attribute & Description

1
android:id

This is the ID which uniquely identifies the view.

2
android:layout_width

This is the width of the layout.

3
android:layout_height

This is the height of the layout

4
android:layout_marginTop

This is the extra space on the top side of the layout.

5
android:layout_marginBottom

This is the extra space on the bottom side of the layout.

6
android:layout_marginLeft

This is the extra space on the left side of the layout.

7
android:layout_marginRight

This is the extra space on the right side of the layout.

8
android:layout_gravity

This specifies how child Views are positioned.


9
android:layout_weight

This specifies how much of the extra space in the layout should be allocated to the View.

10
android:layout_x

This specifies the x-coordinate of the layout.

11
android:layout_y

This specifies the y-coordinate of the layout.

12
android:layout_width

This is the width of the layout.

13
android:layout_width

This is the width of the layout.

14
android:paddingLeft

This is the left padding filled for the layout.

15
android:paddingRight

This is the right padding filled for the layout.

16
android:paddingTop

This is the top padding filled for the layout.

17
android:paddingBottom

This is the bottom padding filled for the layout.

Here width and height are the dimension of the layout/view which can be specified in terms of
dp (Density-independent Pixels), sp ( Scale-independent Pixels), pt ( Points which is 1/72 of an
inch), px( Pixels), mm ( Millimeters) and finally in (inches).
You can specify width and height with exact measurements but more often, you will use one of
these constants to set the width or height −

 android:layout_width=wrap_content tells your view to size itself to the dimensions


required by its content.

 android:layout_width=fill_parent tells your view to become as big as its parent view.

Gravity attribute plays important role in positioning the view object and it can take one or more
(separated by '|') of the following constant values.

Constant Value Description

Top 0x30 Push object to the top of its container, not changing its size.

Bottom 0x50 Push object to the bottom of its container, not changing its size.

Left 0x03 Push object to the left of its container, not changing its size.

Right 0x05 Push object to the right of its container, not changing its size.

center_vertical 0x10 Place object in the vertical center of its container, not changing its size.

fill_vertical 0x70 Grow the vertical size of the object if needed so it completely fills its
container.

center_horizonta 0x01 Place object in the horizontal center of its container, not changing its size.
l

fill_horizontal 0x07 Grow the horizontal size of the object if needed so it completely fills its
container.

Center 0x11 Place the object in the center of its container in both the vertical and
horizontal axis, not changing its size.

Fill 0x77 Grow the horizontal and vertical size of the object if needed so it fill
EVENTS
Events are a useful way to collect data about a user's interaction with interactive
components of Applications.Like button presses or screen touch etc. The Android
framework maintains an event queue as first-in, first-out (FIFO) basis. You can capture
these events in your program and take appropriate action as per requirements.

There are following three concepts related to Android Event Management −

 Event Listeners − An event listener is an interface in the View class that contains a single
callback method. These methods will be called by the Android framework when the View to
which the listener has been registered is triggered by user interaction with the item in the UI.

 Event Listeners Registration − Event Registration is the process by which an Event


Handler gets registered with an Event Listener so that the handler is called when the Event
Listener fires the event.

 Event Handlers − When an event happens and we have registered an event listener for the
event, the event listener calls the Event Handlers, which is the method that actually handles
the event.

Event Listeners & Event Handlers


Event Handler Event Listener & Description

OnClickListener()

onClick() This is called when the user either clicks or touches or focuses upon any
widget like button, text, image etc. You will use onClick() event handler to
handle such event.

OnLongClickListener()

This is called when the user either clicks or touches or focuses upon any
onLongClick()
widget like button, text, image etc. for one or more seconds. You will use
onLongClick() event handler to handle such event.

onFocusChange()
OnFocusChangeListener()

This is called when the widget looses its focus ie. user goes away from the
view item. You will use onFocusChange() event handler to handle such event.

OnFocusChangeListener()

This is called when the user is focused on the item and presses or releases a
onKey()
hardware key on the device. You will use onKey() event handler to handle
such event.

OnTouchListener()

This is called when the user presses the key, releases the key, or any
onTouch()
movement gesture on the screen. You will use onTouch() event handler to
handle such event.

OnMenuItemClickListener()

onMenuItemClick() This is called when the user selects a menu item. You will use
onMenuItemClick() event handler to handle such event.

onCreateContextMenuItemListener()

onCreateContextMenu() This is called when the context menu is being built(as the result of a sustained
"long click)

Using existing android camera application in our


application
You will use MediaStore.ACTION_IMAGE_CAPTURE to launch an existing camera
application installed on your phone. Its syntax is given below

Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

Apart from the above, there are other available Intents provided by MediaStore. They are listed
as follows

Sr.No Intent type and description


1 ACTION_IMAGE_CAPTURE_SECURE

It returns the image captured from the camera , when the device is secured

ACTION_VIDEO_CAPTURE
2
It calls the existing video application in android to capture video

EXTRA_SCREEN_ORIENTATION
3
It is used to set the orientation of the screen to vertical or landscape

EXTRA_FULL_SCREEN
4
It is used to control the user interface of the ViewImage

INTENT_ACTION_VIDEO_CAMERA
5
This intent is used to launch the camera in the video mode

EXTRA_SIZE_LIMIT
6
It is used to specify the size limit of video or image capture size

Now you will use the function startActivityForResult() to launch this activity and wait for its
result. Its syntax is given below

startActivityForResult(intent,0)

This method has been defined in the activity class. We are calling it from main activity. There
are methods defined in the activity class that does the same job , but used when you are not
calling from the activity but from somewhere else. They are listed below

Sr.No Activity function description

1
startActivityForResult(Intent intent, int requestCode, Bundle options)
It starts an activity , but can take extra bundle of options with it

startActivityFromChild(Activity child, Intent intent, int requestCode)


2
It launch the activity when your activity is child of any other activity

startActivityFromChild(Activity child, Intent intent, int requestCode, Bundle options)


3
It work same as above , but it can take extra values in the shape of bundle with it

startActivityFromFragment(Fragment fragment, Intent intent, int requestCode)


4
It launches activity from the fragment you are currently inside

SMS MANAGER IN ANDROID

In Android, you can use SmsManager API or devices Built-in SMS application to send SMS's.
In this tutorial, we shows you two basic examples to send SMS message −

SmsManager API
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage("phoneNo", null, "sms message", null, null);

Built-in SMS application


Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.putExtra("sms_body", "default content");
sendIntent.setType("vnd.android-dir/mms-sms");
startActivity(sendIntent);

Of course, both need SEND_SMS permission.


<uses-permission android:name="android.permission.SEND_SMS" />

Apart from the above method, there are few other important functions available in SmsManager
class. These methods are listed below −

Sr.No. Method & Description


1
ArrayList<String> divideMessage(String text)

This method divides a message text into several fragments, none bigger than the maximum
SMS message size.

2
static SmsManager getDefault()

This method is used to get the default instance of the SmsManager

3
void sendDataMessage(String destinationAddress, String scAddress, short
destinationPort, byte[] data, PendingIntent sentIntent, PendingIntent deliveryIntent)

This method is used to send a data based SMS to a specific application port.

4
void sendMultipartTextMessage(String destinationAddress, String scAddress,
ArrayList<String> parts, ArrayList<PendingIntent> sentIntents,
ArrayList<PendingIntent> deliveryIntents)

Send a multi-part text based SMS.

5
void sendTextMessage(String destinationAddress, String scAddress, String text,
PendingIntent sentIntent, PendingIntent deliveryIntent)

Send a text based SMS.

Android provides Built-in applications for phone calls, in some occasions we may need to make
a phone call through our application. This could easily be done by using implicit Intent with
appropriate actions. Also, we can use PhoneStateListener and TelephonyManager classes, in
order to monitor the changes in some telephony states on the device.

This chapter lists down all the simple steps to create an application which can be used to make a
Phone Call. You can use Android Intent to make phone call by calling built-in Phone Call
functionality of the Android. Following section explains different parts of our Intent object
required to make a call.
CONTROL FLOW DIAGRAM OF LOGIN PAGE

Login Page

Click generate
OTP is also stored in string . OTP Button

Enter Phone
. . Number

Enter OTP in
Edit . Text

OTP OTP don’t


matches matches
Tab Panel Re Enter OTP
having . 3
tabs

Complaint Camera
Safety Form
centre
Control flow diagram of first tab

Complaint
. Centre

FIR
Button
Complain

Online FIR
webpage Online
NGO
Complaint

Control Flow diagram of second tab

Safety Form

Enter Phone
Number and other .
. details

Click
Emergency . .
Button

Your Details sent to Calling to Women


receivers number Your Location sent . Helpline No
. to Receivers .
. number
Control Flow diagram of third tab
Click photo
button

Camera Opens up

After clicking shows


you image for review

If you click ok then If you click Retry


control returns to
camera home

About My Project
As soon as we open the app we see the login page . It appears as shown below in
the image. It contains a phone number field where you have to enter your phone
number.
When you will enter the phone number and click on generate otp button you will
receive a text message of otp and a toast will be displayed showing the otp sent
message. Now after pressing the generate otp button you will see the below shown
message. The otp is being generated with help of random variable and that value is
alsobeing stored in string for further checking.
Now fill the text you get as otp in the edit text provided and than click on submit
Button . Now the value from edit text will be picked up and will be compared with
the otp that had been generated and had been stored as a string . If otp does not
matches than following text will be displayed.

If OTP matches than you will enter the tab activity. It contains 3 tabs named
1. Complain
2. Safety Form
3. Camera

COMPLAIN TAB
Complain Tab contains 2 buttons.

1.FILE FIR TO POLICE


2. FILE COMPLAINT TO NGO

On clicking on file fir to police the online fir portal of police will open and you can
register fir there. In this we are redirecting you to the online web page of FIR
maintained by police

On clicking register a complaint to NGO an online complaint portal of ngo will


open up. In this we are redirecting you to online web page of an N.G.O where you
could make complaints about the problems faced by the women. This is being done
with the help of web view feature of android.

Here you can register your complaints to N.G.O

Second tab
Second Tab is Safety Form which deals with safety message sending . It contains
various fields like receivers phone no meaning to which phone no you will like to
send message. And then you have to fill other details which you have to send to
receivers number

Following is the example of filled form


As soon as you will click the emergency button 3 activities takes place
1. A call will be made to women helpline number
2. Message regarding the safety form will be sent to receivers number .
3. Message regarding your location will be sent to receivers number.
Third Tab
Third tab is camera in which you have click photo button.As soon as you will
click on it camera will open up and you can click photo there.
There are 2 buttons here ok and retry if you click ok than photo will be displayed
in tab and if you click retry than the camera will again open up
LIMITATIONS

The person must have balance in his phone sim in order to Call and also to send
messages. In case balance is not present in person sim card he will not be able to
take advantage of any facility related to emergency.
Installation of Project

1. Firstly install android studio to your System as explained in the introductory part
of android studio.
2. Click on import project.
3. And import my project in it.
4. You will see that there are no error in my application so you could easily run it
5. Take your android phone and Go to settings
6. In settings go to about device options.
7. There is a built number present there click on it 5 times.
8. The device will show you message that developer options has been enabled.
9. Now connect USB to android device and connect other end of USB cable to
your system and in android studio click on run button
10. Your app will be automatically Launched.
REFERENCES

[1]. Deital and Deital, Java How to Program, Prentice Hall (2007).
[2].Herbert Schildt, Java: The Complete Reference, McGraw-Hill.
[3].https://www.w3schools.com/sql/default.asp
[4].https://www.tutorialspoint.com/sql/
[5].https://www.javatpoint.com/java-tutorial
[6].Korth, Silberschatz, Database System Concepts , 4th Ed., TMH, 2000.

You might also like