Arbaminch University: Criminal Record Management System
Arbaminch University: Criminal Record Management System
Arbaminch University: Criminal Record Management System
SCHOOL OF ENGINEERING
Department of Electrical & computer Engineering
PROJECT REPORT
Group members:
Natnael Asnake (T/0004/12)
Abenezer Wondimu (T/0007/12)
Biniyam Deyas (370/11)
Teacher In-Charge
Table of Contents
ABSTRACT ................................................................................................................................... i
ACKNOWLEDGEMENT ............................................................................................................ ii
ABBREVIATIONS AND SYMBOLS ........................................................................................ iii
TABLE OF FIGURES ................................................................................................................. iv
LIST OF TABLES ....................................................................................................................... iv
CHAPTER ONE ........................................................................................................................... 1
1. SPECIFIC REQUIREMENT SOFTWARE............................................................................ 1
1.1. INTRODUCTION ........................................................................................................ 1
1.2. Statement of the problem .............................................................................................. 1
1.3. Objectives ..................................................................................................................... 1
1.3.1. General objective ........................................................................................................... 1
1.3.2. Specific objectives ......................................................................................................... 1
1.4. Scope ............................................................................................................................ 2
1.5. Overview ...................................................................................................................... 2
1.6. Overall Description....................................................................................................... 2
1.7. Product Perspective ...................................................................................................... 2
1.8. Product Functions ......................................................................................................... 2
1.8.1. Process Data .............................................................................................................. 2
1.8.2. Add User ................................................................................................................... 3
1.8.3. Search Record ........................................................................................................... 3
1.9. Constraints, Assumptions and Dependencies ............................................................... 3
1.10. Specific Requirements .............................................................................................. 3
1.10.1. Interface Requirements ............................................................................................. 3
1.10.2. Functional Requirements .......................................................................................... 3
1.10.3. Non-Functional Requirements .................................................................................. 4
1.11 Project Organization ........................................................................................................ 4
CHAPTER TWO........................................................................................................................... 5
2. LITERATURE REVIEW ........................................................................................................ 5
CHAPTER THREE ....................................................................................................................... 6
3. METHODOLOGY .................................................................................................................. 6
3.1 INTRODUCTION ............................................................................................................... 6
3.2 Software Development Life Cycle (SDLC) ........................................................................ 6
3.3.1 Feasibility Study .............................................................................................................. 6
3.3.2 Requirement Definition .................................................................................................... 7
3.3.3 System Analysis ............................................................................................................... 7
3.3.4 System Design .................................................................................................................. 7
3.3.5 Coding .............................................................................................................................. 7
3.3.6 Testing .............................................................................................................................. 8
3.3.7 Implementation ................................................................................................................. 8
3.4 Design Constraints ............................................................................................................. 8
3.5 Data Flow Diagram and Data Dictionary .......................................................................... 8
3.6 Use Case Model ............................................................................................................... 11
3.7 Block Diagram ................................................................................................................. 15
3.8 Flow chart of the system .................................................................................................. 16
3.9 ER DIAGRAM ................................................................................................................ 17
3.8 Activity Diagram ............................................................................................................. 18
5.7 Summary ............................................................................................................................... 19
CHAPTER FOUR ....................................................................................................................... 20
4. ARCHITECTURAL DESIGN .............................................................................................. 20
CHAPTER FIVE ......................................................................................................................... 22
5. RISK ANALYSIS ................................................................................................................. 22
5.1 Compromising login credentials ................................................................................. 22
5.2 Registration Risk ........................................................................................................ 22
5.3 Risk of storage of database space ............................................................................... 22
5.4 Risk of Improperly Denied Access ............................................................................. 23
5.5 Risk of Litigation Exposure ........................................................................................ 23
CHAPTER SIX ........................................................................................................................... 24
6. PROJECT CODE .................................................................................................................... 24
Admin Activity ...................................................................................................................... 27
6.2.1 Background ............................................................................................................. 29
Background add criminal....................................................................................................... 32
6.3.1 Adapters .................................................................................................................. 35
6.4.1 Fragments ................................................................................................................ 36
a) PHP Code ...................................................................................................................... 39
Add User ................................................................................................................................ 39
Login ...................................................................................................................................... 40
Upload Image ........................................................................................................................ 41
Screenshot of the Software .................................................................................................... 43
CHAPTER SIX ........................................................................................................................... 44
b) CYCLOMATIC COMPLEXITY .................................................................................. 45
6.2.2. To Find Independent Path ....................................................................................... 46
6.3 Test Cases For Independent Path................................................................................ 46
CHAPTER SEVEN ..................................................................................................................... 47
7. USER MANUAL .................................................................................................................. 47
a) Login Page..................................................................................................................... 47
b) Adding Criminal ............................................................................................................ 47
CHAPTER EIGHT ...................................................................................................................... 48
8. CONCLUSION ..................................................................................................................... 48
9. REFERENCES ...................................................................................................................... 49
ABSTRACT
The main aim of the project is to develop a Criminal Record Management system. The project is
mainly useful for police departments. This system will help to manage all the data of the criminals
of a jail. There are either only web-based applications or it is driven manually in most of the
organizations. The application will provide a multiuser platform. There will be two types of login
in this, one will be the admin user and other will be the authorized user. The admin can read and
write data on the database. The authorized user could only read records from database. There will
also a functionality to match the criminal record by matching with a sketch/picture.
i
ACKNOWLEDGEMENT
Primarily we would thank god for being able to complete this project with success. Then we would
like to thank our Software engineering teacher, Mr. Guta.T for giving this project.
Then we would like to thank our parents and friends who have helped me with their valuable
suggestions and guidance has been very helpful in various phases of the completion of the project.
ii
ABBREVIATIONS AND SYMBOLS
1. CRMS……………………………………….. Criminal Record Management System
2. CR………………………………………….... Criminal Record
3. DFD………………………………………….. Data Flow Diagram
4. ERD………………………………………….. Entity Relationship Diagram
5. HTML……………………………………..….. Hypertext Markup Language
6. PHP…………………………………………... Hypertext Preprocessor
7. RAM……………………………………..….. Random Access Memory
8. SDLC………………………………………… Software Development Life Cycle
9. SQL………………………………………….. Structured Query Language
10. SRS……………………………………….….. Software Requirements Specification
iii
TABLE OF FIGURES
Figure 1 Software Development Life Cycles ..................................................................................... 6
Figure 2: Data flow diagram level - 0................................................................................................. 8
Figure 3: Data flow diagram level - 1................................................................................................. 9
Figure 4: Use case diagram for CRMS ............................................................................................. 11
Figure 5: Sequence diagram of login ................................................................................................ 12
Figure 6: Sequence diagram for Add criminal ................................................................................. 12
Figure 7: Sequence diagram for Add crimes .................................................................................... 13
Figure 8: Sequence diagram for Create Account.............................................................................. 13
Figure 9: Sequence diagram for Add court, and Add prison ............................................................ 14
Figure 10: Sequence diagram for Crime Report, and add Punishment ............................................ 14
Figure 11: Class diagram of entity classes ....................................................................................... 15
Figure 12: Block diagram of CRMS................................................................................................. 15
Figure 13: Flow chart of CRMS ....................................................................................................... 16
Figure 14: ER diagram of CRM ....................................................................................................... 17
Figure 15: Activity Diagram of Admin ............................................................................................ 18
Figure 16: Activity Diagram of Sub-Admin..................................................................................... 18
Figure 17: Activity Diagram of Police-User .................................................................................... 19
Figure 18: Activity Diagram of Court-User ..................................................................................... 19
FIGURE 19: Architectural Design ................................................................................................... 20
Figure 20: Admin Login Page .......................................................................................................... 43
Figure 22: Cyclomatic Complexity ................................................................................................. 45
LIST OF TABLES
Table 1: Data Dictionary .................................................................................................................. 10
iv
CHAPTER ONE
1.1. INTRODUCTION
CRMS is an android application which is supported on all android versions above android
KITKAT. This system will help to manage all the data of the criminals of a jail. There are either
only web-based applications or it is driven manually in most of the organizations. The application
will provide a multiuser platform.
1.2. Statement of the problem
Araminch city administration police office station applies manual way of crimes management
system and processing of tasks. Due to this reason, the existing manual processing has the
following problems
-It takes much efforts and time to retrieve crime information
-Difficulty of updating information timely in each departments of the office
-File control mechanism is very tedious, Complicated and not secured.
-High material resource wastage (written materials) and much cost are expanded for handling
records.
-Difficulty in conducting consistent reports.
-The same detail of crime information is recorded in multiple places (documents), this indicates
redundancy.
1.3. Objectives
1.3.1. General objective
Our major objective is to develop an Online Crime Management System for Arbaminch city
administration police office.
1.3.2. Specific objectives
To achieve the general objectives of the project, the proposed system consists of the following
specific objectives:
-To easily manage unauthorized person.
-To Identifying the valid and invalid requirement system.
-To minimize a labor force.
-To make the newly developed system is flexible, reliable and efficient.
1
1.4. Scope
This document covers the whole definition of the Criminal Record Management System
(CRMS) project. It basically includes data of criminals which will be of great help to police
officers. By taking security in consideration, the authentication is of great concern. Also, normal
users can only view the records of criminal. Only admin can make changes to database.
1.5. Overview
This SRS is organized in a way that any user of the organization can easily understand and use the
CRMS. In other words, it constitutes a user guideline for CRMS. Basically, this document starts
with a brief explanation of the problem. Later on, it continues with a detailed solution we proposed.
Also block diagrams of our solution to visualize the solution and system better, specific and
functional requirements, interface requirements, constraints that may be confronted while
developing the software, relationship between user types each of which is a data object. This
document ends with the planning and estimating the basic schedule of our process.
2
order to obtain the list of the criminal record by comparing images. Also, a user may also see the
specific information about a criminal which can be named as report.
The entire user will be taken to a user authentication page. If the user is already registered he/she
can login directly through there or in case of admin there is an option below the login button to
go to admin authentication page. From there admin can login. After login, admin will get three
tabs as follows:
Add data tab: With the help of this tab, admin will be able to add data of the criminal to database
such as name, contact number, address… etc.
Update data tab: his tab will enable the admin to update the record of the criminal in the database.
Delete data tab: This tab will enable the admin to delete records of a particular criminal from the
database. If the user signs in as normal user instead of admin, then he/she will get only one tab in
which there will be only the listing of all criminals present in the database.
3
Authentication: Login User can login to the CRMS system with his/her username and password.
Logout User cans logout from the CRMS system. Login failure if the user does not exist in the
database or the user did not get authorized by the CRMS admin yet.
Authorization: User role check after logging in, the user role will be checked from the database
and the user interface will be created according to that role/roles.
Process data: Display User with defined roles can display the content of the database. Being more
specific, a normal user can only view criminal data. Admin can see not only criminal data but also
alter the database. A normal user can search a criminal record but entering the id of the criminal
or by uploading an image to the application.
4
CHAPTER TWO
2. LITERATURE REVIEW
2.1. Prakruthi Prakasha, et.al [1]. In this research work, the web-based criminal record system
(CRS) aims to use mobile devices in place of traditional GPS devices in order to facilitate
the police to record the location of the committed crime. Despite from the location-based
service, the CRS offers the police to describe the detail and simultaneously attach the
images or multimedia files. The online crime reporting system has been developed to
override the problems prevailing in the practicing manual system. This software is
supported to eliminate in some cases reducing the hardships faced by the existing system.
2.2. Murat Dağlar, et.al [2]. As essential apparatus in crime analysis, crime mapping and
Geographical Information Systems (GIS) are being progressively more accepted by
police agencies. Development in technology and the accessibility of geographic data
sources make it feasible for police departments to use GIS and crime mapping. GIS and
crime mapping can be utilized as devices to discover reasons contributing to crime, and
hence let law enforcement agencies proactively take action against the crime problems
before they become challenging. The purpose of this study is to conduct a literature
review of Geographical Information System and Crime Mapping in Crime Analysis and
to propose policy recommendations regarding to implementation of crime mapping and
GIS.
2.3. Prof. V. V. Bhujade, et.al [3]. This feature is made available to public for interaction with
police indirectly. This system registers the complaints from people through online and is
helpful to the police department in identifying criminals. In this system any person can
register their complaint online. The aim ofthis project is to develop an E-cops reporting
and management system which is easily accessible to the public, police department and
the administrative department. Generally many crimes seen by the public will not reach
to the police due to many reasons like fear, lack of time, ignorance. Due to this reason
many cases are not even reported to the police station. Though some cases are registered
they are not investigated properly due to lack of evidences and cooperation of the public.
5
CHAPTER THREE
3. METHODOLOGY
3.1 INTRODUCTION
A software development methodology or system development methodology in software
engineering is a framework that is used to structure, plan and control the process of development
information system. There are many of methodology in my project it does not strictly follow a
single methodology. It has been development by considering waterfall methodology.
3.2 Software Development Life Cycle (SDLC)
The cycle of the software development gives us an overview and guidelines for the
development of quality software. For our project, we follow SDLC to make reliable for the user.
Planning
Deployment Defining
Testing Designing
Building
6
3.3.2 Requirement Definition
A requirement is a physical and functional need that a particular design, product or process must
be able to perform. It is commonly used in a formal sense in system engineering, software
engineering and enterprise engineering.
Requirement Definition involves three major frames are:
-Requirement Analysis
-Requirement Specification
-Requirement Validation
3.3.3 System Analysis
System analysis is the process of collecting a factual data, understand the process involved,
identifying problem and recommending feasible suggestion for improving the system
functioning, this involving studying the business process, gathering operational data, understand
the information flow, finding out bottlenecks and evolving solution for overcoming the weakness
of the system so as to achieve the organization goals. System analysis also includes subdividing
of complex process involving the entire system, identification of data store and manual process.
These major objectives of system analysis are to find answers for each business process:
-What is being done?
-How is it being done?
-Who is doing it?
-When is he doing it? Why is it being done?
-How can it be improved?
3.3.4 System Design
The design phase is the architectural phase of system design. The flow of data processing is
developed into charts, and the project team determines the most logical design and structure for
data flow and storage. For user interface, the project team designs mock-up screen layouts that
developers use to write the code for the actual interface
3.3.5 Coding
In the SDLC model, the design and coding of the program involves only 10% of the project’s
commitment, here we compose the coding using a well-understood programming language like
PHP, HTML, CSS3, BOOTSRAP, JAVASCRIPT, JQUERY, and MYSQL [6].
7
3.3.6 Testing
Involves executing and implementation of the software with test data and examining the outputs
of the software and its operational behavior to check that is performing as required testing can be
implementation in two ways.
- White box testing
- Black box testing
3.3.7 Implementation
The installation and acceptance stage is the final stage of SDLC. In this stage, the software is
installed in the client place and the users are trained in using the new software
3.4 Design Constraints
Hardware Requirements: The CRMS application will be storing 500 criminals’ data which will
roughly requires 100 MB of database storage space.
Software Requirements: Since our CRMS project is an android-based application, so we will
require mobile handsets for the deployment of the project. To store and fetch the data to and from
the database online i.e. MySQL database on the local host server, the user also requires an active
internet connection for smooth working of the project. The CRMS will run on any mobile phone
with android 4.4 or higher. Application will run on 256MB or higher of RAM. It requires a space
of 2.5 MB to deploy onto the machine.
3.5 Data Flow Diagram and Data Dictionary
8
Criminal
Record
Table
SEARCH
Crimina Searc
l h
Record Query
Operation
Database
User Crimina
Admin
l Data
LOGIN
s
Authenticat
e User
USE
SIGN UP
Create R
User
TABL
E
9
Table 1: Data Dictionary
DATA DICTIONARY
Name Description
10
3.6 Use Case Model
Login
New
criminal id
Add Crime
Create
Account
Police
Add Prison
Crime
Report
Add
Punishment
11
Figure 5: Sequence diagram of login
12
Figure 7: Sequence diagram for Add crimes
13
Figure 9: Sequence diagram for Add court, and Add prison
Figure 10: Sequence diagram for Crime Report, and add Punishment
14
Figure 11: Class diagram of entity classes
Management System
View Crime Report View whole system
Admin
The figure above shows different function of admin, sub-admin, police, and court in block of
Criminal record management system
15
3.8 Flow chart of the system
Start
Login
No
If
Registered?
Add View
Create Account Create Account
criminal/crime Criminal/crime
View View
Criminal/crime Criminal/crime
End
The above figures shows the application process flow using symbol, where any user can login
into System if he has no account then the admin or sub-admin can create an account to
him/her. After creation of account user this system based on user type for their respective
functionalities show in flow diagram.
16
3.9 ER DIAGRAM Messages
Email Police
Users
JobID
F.name
ID
F.name
L.name L.name
User id
Court
Prison
Has
Court-id
Prison- id
Symbol
Mother-n
Address
Father-n
Criminal-id Criminal
Has DOB
Police-id
Address
Case-no
Contact-no
Place
L.name
Crime
NID
Crime-C
Court-id Id F.name
Punishm
Prison-ID
17
3.8 Activity Diagram
An activity diagram visually presents a series of action or flow of control in system.
Login
Logout
Login
Logout
18
Login
Add View
Criminal/crime Criminal/crime
Logout
Login
Logout
5.7 Summary
In this chapter, we have described whole system with various design tools like E-R diagram,
system context diagram, activity diagram and block diagram.
19
CHAPTER FOUR
4. ARCHITECTURAL DESIGN
CRMS
AUTHENTICATE
CREATE USER COMPARE ADD DATA
USER
DELETE DATA
1. Sign Up: This module takes all the details of the user including the personal details.
a) Create Users: This module helps in the registration of the user into the database of
the organization.
2. Login: This module provides the most important functionality to the application, the
security feature of login module
20
3. Search: This module helps the user to compare a criminal’s data to the whole database
and finding data of the required criminal.
4. Admin: This module will allow admin to manipulate database, i.e.; by adding data,
update some present data and deleting data from the database.
21
CHAPTER FIVE
5. RISK ANALYSIS
While deploying a project, several risks are always there with different probability of happening
and different consequences. Here we are giving to such risks for our project.
What if the organization faces the shortage of database space for storing the application database?
Then the CRMS application will not work properly. To resolve this, the organization has to
redesign the company database and some changes to the CRMS application which will add cost of
22
the application to the organization. The probability of this to the organization is less in short term
and has a little higher risk in the long term.
5.4 Risk of Improperly Denied Access
Nothing is more frustrating than being denied access to information you need to properly do your
job. Improperly denied access can prevent: addition of new criminal to database, updating in the
criminal record; deletion of criminal record, getting information of the criminals, searching for a
particular criminal. The probability of this risk is moderate to the organization.
Criminal information is, by its very nature, confidential. It is the responsibility of ADMIN to
safeguard criminals’ records by controlling access to personnel information. A breakdown in this
area and the resulting misuse of this information can expose an organization to significant litigation
expenses and monetary damages.
23
CHAPTER SIX
6. PROJECT CODE
6.1 ANDROID CODE
6.1.1 ACTIVITIES
MAIN ACTIVITY
packagecom.example.natnael.crmsv2.Activitie
s; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.example.rahul.crmsv2.Background.BackgroundLogin;
import com.example.rahul.crmsv2.R;
EditText editText_username,editText_password;
CardView cardView_login;
TextView textView_admin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editText_password=findViewById(R.id.etPass_main);
editText_username=findViewById(R.id.etUsername_main);
cardView_login=findViewById(R.id.card_login);
textView_admin=findViewById(R.id.tv_admin_main);
24
ConnectivityManager connectivityManager=(ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo=connectivityManager.getActiveNetworkInfo();
if (networkInfo!=null && networkInfo.isConnected())
{
textView_admin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new
Intent(getApplicationContext(),AdminAuthorizationActivity.class));
}
});
cardView_login.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String userName=editText_username.getText().toString();
String password=editText_password.getText().toString();
25
}
}
Admin Activity
package com.example.natnael.crmsv2.Activities;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.PorterDuff;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.EditText;
import android.widget.TextView;
import com.example.natnael.crmsv2.Adapters.PagerViewAdapter;
import
com.example.natnael.crmsv2.Background.BackgroundAddUser;
import com.example.natnael.crmsv2.R;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_admin);
addData=findViewById(R.id.addData);
updateData=findViewById(R.id.update);
delteData=findViewById(R.id.delete);
viewPager=findViewById(R.id.mainPager);
pagerViewAdapter=new PagerViewAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerViewAdapter);
27
addData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
viewPager.setCurrentItem(0);
}
});
updateData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
viewPager.setCurrentItem(1);
}
});
delteData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
viewPager.setCurrentItem(2);
}
});
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@Override
public void onPageSelected(int position) {
changeTabs(position);
@Override
public void onPageScrollStateChanged(int state) {
}
});
28
updateData.setTextColor(getResources().getColor(R.color.textTabLight));
updateData.setTextSize(16);
delteData.setTextColor(getResources().getColor(R.color.textTabLight));
delteData.setTextSize(16);
}
if (position==1)
{
addData.setTextColor(getResources().getColor(R.color.textTabLight));
addData.setTextSize(16);
updateData.setTextColor(getResources().getColor(R.color.textTabBright));
updateData.setTextSize(22);
delteData.setTextColor(getResources().getColor(R.color.textTabLight));
delteData.setTextSize(16);
}
if (position==2)
{
addData.setTextColor(getResources().getColor(R.color.textTabLight));
addData.setTextSize(16);
updateData.setTextColor(getResources().getColor(R.color.textTabLight));
updateData.setTextSize(16);
delteData.setTextColor(getResources().getColor(R.color.textTabBright));
delteData.setTextSize(22);
}
}
}
6.2.1 Background
Background Login
packagecom.example.natnael.crmsv2.Backgroun
d; import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.util.Log;
import com.example.rahul.crmsv2.R;
29
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
* Created by natnael,aby,biniyam.
*/
Context context;
ProgressDialog progressDialog;
@Override
protected void onPreExecute() {
// super.onPreExecute();
progressDialog.setProgressStyle(R.style.Theme_AppCompat_DayNight_DarkActionBar);
progressDialog.setCancelable(false);
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Logging in..");
progressDialog.show();
}
@Override
protected String doInBackground(String... voids) {
String loginUrl="http://192.168.43.92/CRMSV2/Login.php";
String userName=voids[0];
String password=voids[1];
Log.d("username",userName);
Log.d("password",password);
try {
30
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
URL url=new URL(loginUrl);
HttpURLConnection httpURLConnection=(HttpURLConnection)url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
OutputStream outputStream=httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter=new BufferedWriter(new
OutputStreamWriter(outputStream,"UTF-8"));
String loginData= URLEncoder.encode("userName","UTF-
8")+"="+URLEncoder.encode(userName,"UTF-8")+"&"+
URLEncoder.encode("password","UTF-
8")+"="+URLEncoder.encode(password,"UTF-8");
bufferedWriter.write(loginData);
bufferedWriter.flush();
bufferedWriter.close();
outputStream.close();
InputStream inputStream=httpURLConnection.getInputStream();
BufferedReader bufferedReader=new BufferedReader(new
InputStreamReader(inputStream,"UTF-8"));
String response="";
String line="";
while((line=bufferedReader.readLine())!=null)
{
response+=line;
}
bufferedReader.close();
inputStream.close();
httpURLConnection.disconnect();
return response;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onProgressUpdate(Void... values) {
31
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(String aVoid) {
// super.onPostExecute(aVoid);
progressDialog.dismiss();
Packagecom.example.natnael.crmsv2.Background
; import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.widget.Toast;
import com.example.rahul.crmsv2.R;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
32
* Created by natnael,abiy,biniyam on 25/08/22.
*/
Context context;
ProgressDialog progressDialog;
String addUserUrl;
@Override
protected void onPreExecute() {
// super.onPreExecute();
// progressDialog.setProgressStyle(R.style.Theme_AppCompat_DayNight_DarkActionBar);
// progressDialog.setCancelable(false);
// progressDialog.setIndeterminate(true);
// progressDialog.setMessage("Signing Up..");
// progressDialog.show();
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// progressDialog.dismiss();
// }
// },3000);
}
@Override
protected String doInBackground(String... voids) {
String addUserUrl="http://192.168.43.92/CRMSV2/addCriminal.php";
String name=voids[0];
String crime=voids[1];
String addr=voids[2];
String phone=voids[3];
String rel=voids[4];
String arrstDate=voids[5];
String aadhar=voids[6];
// String Aadhar=voids[7];
// try {
// Thread.sleep(3000);
// } catch (InterruptedException e) {
// e.printStackTrace();
33
// }
try {
URL url=new URL(addUserUrl);
HttpURLConnection httpURLConnection=(HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
OutputStream outputStream=httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter=new BufferedWriter(new
OutputStreamWriter(outputStream,"UTF-8"));
String userData= URLEncoder.encode("name","UTF-
8")+"="+URLEncoder.encode(name,"UTF-8")+"&"+
URLEncoder.encode("crime","UTF-8")+"="+URLEncoder.encode(crime,"UTF-
8")+"&"+
URLEncoder.encode("addr","UTF-8")+"="+URLEncoder.encode(addr,"UTF-
8")+"&"+
URLEncoder.encode("phone","UTF-8")+"="+URLEncoder.encode(phone,"UTF-
8")+"&"+
URLEncoder.encode("rel","UTF-8")+"="+URLEncoder.encode(rel,"UTF-8")+"&"+
URLEncoder.encode("arrstDate","UTF-
8")+"="+URLEncoder.encode(arrstDate,"UTF-8")+"&"+
URLEncoder.encode("aadhar","UTF-8")+"="+URLEncoder.encode(aadhar,"UTF-
8");
bufferedWriter.write(userData);
bufferedWriter.flush();
bufferedWriter.close();
outputStream.close();
InputStream inputStream=httpURLConnection.getInputStream();
return response;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
34
return null;
}
@Override
protected void onProgressUpdate(Void... values) {
// super.onProgressUpdate(values);
@Override
protected void onPostExecute(String aVoid) {
super.onPostExecute(aVoid);
Toast.makeText(context,aVoid,Toast.LENGTH_LONG).show();
}
6.3.1 Adapters
package com.example.rahul.crmsv2.Adapters;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.example.natnael.crmsv2.Fragments.AddDataFragment;
import com.example.natnael.crmsv2.Fragments.DeleteDataFragment;
import com.example.natnael.crmsv2.Fragments.UpdateFragment;
/**
* Created by rahul on 3/4/18.
*/
@Override
35
public Fragment getItem(int position) {
switch (position)
{
case 0:
return new AddDataFragment();
case 1:
return new UpdateFragment();
case 2:
return new DeleteDataFragment();
default:
return null;
}
}
@Override
public int getCount() {
return 3;
}
}
6.4.1 Fragments
package com.example.rahul.crmsv2.Fragments;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import
com.example.natnael.crmsv2.Background.AddCriminal;
import
com.example.natnael.crmsv2.Background.UploadImage;
import com.example.natnael.crmsv2.R;
import java.io.IOException;
36
import de.hdodenhof.circleimageview.CircleImageView;
/**
* A simple {@link Fragment} subclass.
*/
public class AddDataFragment extends Fragment {
public AddDataFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view=inflater.inflate(R.layout.fragment_add_data,container,false);
name=view.findViewById(R.id.nameCriminal);
crime=view.findViewById(R.id.crimeCriminal);
addr=view.findViewById(R.id.addrCriminal);
phone=view.findViewById(R.id.phoneCriminal);
rel=view.findViewById(R.id.relCriminal);
arrstDate=view.findViewById(R.id.arrstDateCriminal);
aadhar=view.findViewById(R.id.aadharCriminal);
submit=view.findViewById(R.id.btnSubmit);
image=view.findViewById(R.id.imageCriminal);
image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"SelectPicture"),PICK_IMAGE);
}
});
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
37
String Name=name.getText().toString();
String Crime=crime.getText().toString();
String Addr=addr.getText().toString();
String Phone=phone.getText().toString();
String Rel=rel.getText().toString();
String ArrstDate=arrstDate.getText().toString();
String Aadhar=aadhar.getText().toString();
name.setText("");
crime.setText("");
addr.setText("");
phone.setText("");
rel.setText("");
arrstDate.setText("");
aadhar.setText("");
}
}
});
return view;
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==PICK_IMAGE)
{
imageUri=data.getData();
try {
bitmap=
MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(),imageUri);
image.setImageBitmap(bitmap);
38
uploadImage.execute(bitmap);
} catch (IOException e) {
e.printStackTrace();
}
}
}
a) PHP Code
Add Criminal
<?php
include 'init.php';
$name=$_POST["name"];
$crime=$_POST["crime"];
$addr=$_POST["addr"];
$phone=$_POST["phone"];
$rel=$_POST["rel"];
$arrstDate=$_POST["arrstDate"];
$aadhar=$_POST["aadhar"];
$sql="insert into criminal (cName, cCrime, cAddress, cPhone, cRelative, cArrestDate,) values
('$name', '$crime', '$addr', '$phone', '$rel', '$arrstDate', '$aadhar');";
$res=mysqli_query($conn, $sql);
if ($res) {
echo "Data added successfully..";
}
else
{
echo "An error occured while adding the data..";
}
?>
Add User
<?php
39
include 'init.php';
$name=$_POST["name"];
$userName=$_POST["userName"];
$Password=$_POST["Password"];
$DOB=$_POST["DOB"];
$phone=$_POST["phone"];
$email=$_POST["email"];
$Designation=$_POST["Designation"];
$Aadhar=$_POST["Aadhar"];
if ($resultCheck>0) {
echo "User Already Exits..";
}
else
{
$sql="insert into users
(uname,uPassword,uDOB,uPhone,uDesingnation,uEmail,uAadhar,uUsername) values
('$name','$Password','$DOB','$phone','$Designation','$email','$Aadhar','$userName');";
$result=mysqli_query($conn,$sql);
$resultCheck=mysqli_num_rows($result);
echo "Registeration Success..";
}
// echo "<pre>";
// var_dump($GLOBALS);
// echo "</pre>";
?>
Login
<?php
include 'init.php';
$userName=$_POST["userName"];
$password=$_POST["password"];
40
$resultCheck=mysqli_num_rows($result);
if ($resultCheck==1) {
echo "Logged In Suucessful..";
}
else
{
if ($resultCheck==0) {
echo "Authentication failed..";
}
else
{
echo "Error in Authentication..";
}
}
?>
Upload Image
<?php
include 'init.php';
$image=$_POST["image"];
//var_dump($image);
$res = mysqli_query($conn,$sql);
$id = 0;
while($row = mysqli_fetch_array($res)){
$id = $row['id'];
}
$path = "uploads/$id.jpg";
$imageName="$id.jpg";
$actualpath = "http://localhost/CRMSV2/$path";
41
if(mysqli_query($conn,$sql)){
file_put_contents($path,base64_decode($image));
// echo "$path<br>";
// echo "base64_decode($image)<br>";
echo "Successfully Uploaded";
}
else
{
echo "Error in uploading image";
}
?>
42
Screenshot of the Software
43
CHAPTER SIX
6. TESTING
a) PSEUDO CODE
• <?php
• include 'init.php';
• $userName=$_POST["userName"];
• $password=$_POST["password"];
• $result=mysqli_query($conn,$sql);
• $resultCheck=mysqli_num_rows($result);
• if ($resultCheck==1) {
• else
• {if ($resultCheck==0) {
13. else{
15. }
16.?>
44
b) CYCLOMATIC COMPLEXITY
R3
8
10
9
13
R1 11 R2
12
16 14
15
C = 17 – 16 + 2
C=3
(c) C=p+1
C = 2 + c (8th and 11th node)
46
CHAPTER SEVEN
7. USER MANUAL
The CRMS software is an android application. Following are the requirement for the proper
deployment of the software:
In this section of the project, the user has to login with the credentials provided to him/her by
the admin of the organization. Depending upon the user details, if the details are correct, a
different application layout is there for the admin and for all other users of the organization
which will provide different functionality depending on the permission granted to them.
For a new user, only the admin can create a new user using his password /details and then
provide the login details of the user to him/her so that any other outsider will not violate the
security of the application.
Users can logout from his/her id at any time using the logout tab at the top right corner of the
home page.
b) Adding Criminal
For adding criminal section, the admin is required to login, as an outsider to the organization
cannot access the database manipulation section of the application.
47
CHAPTER EIGHT
8. CONCLUSION
We can conclude that criminal record management system can help police officers, jailors, CBI
officers in order to deal with criminal records. It can help jail organizations going smoothly
using technology. Organization can improve their management system from traditional
approach to a modern approach that using a technology base. In addition, organization can take
advantage in competition when their organization more advances.
There are some benefits of implementing CRMS:
1. The CRMS provides uniformity through templates and predetermined procedures for
uploading data and downloading reports. It also means that data retrieved and viewed
is in a format that is easily identifiable and user friendly.
2. Knowledge management is an important element in successful CRMS. CRMS become
a house of important information on the various aspects of a criminal history.
Lastly, we enjoy this subject that can make me understand about criminal record
management system. We can use this knowledge for our future.
48
9. REFERENCES
[1] Prakruthi Prakasha, Veekshitha, Rashmitha R, Shetty Diksha Dinesh, Shilpa, developed
“A Web-based Criminal Record System Using Mobile Device for recording criminals”,
International Journal of Research and Scientific Innovation (IJRSI), Volume V, Issue V,
May 2018
[2] Murat Dağlar, Uğur Argun “Crime Mapping and Geographical Information Systems in
Crime Analysis”, International journal of Human Sciences, Vol. 13, Issue. 1, Year: 2016
[3] Prof. V. V. Bhujade, Teena N. Tadas, Sweta P. Lende, Rohini R.Hiwarkar “eCOPS -
Electronics Police Record Management System” International Journal on Recent and
Inovation trends in computing and communication, Vol: 2 Issue: 3, 2014. Software
Engineering by K.K. Aggarwal and Yogesh Singh
[3] https://www.tutorialsduniya.com
[4] Software Engineering: A Practitioner’s Approach by Roger
49