Criminal Record Management System - TutorialsDuniya
Criminal Record Management System - TutorialsDuniya
COM
Criminal Record
Management System
Software Engineering Project
om
SOFTWARE ENGINEERING PROJECT REPORT
.c
ya
B.Sc. (H) Computer Science
i
un
D
ls
ia
or
ACKNOWLEDGEMENT
In the accomplishment of this project successfully, many people have best owned upon us their
om
blessings and the heart pledges support, this time we are utilizing to thank all the people who
.c
Primarily we would thank god for being able to complete this project with success. Then we
ya
would like to thank our principal TutorialsDuniya.Com and our software engineering
i
valuable guidance has been the once that helped me patch this project and make it full proof
un
success. Their suggestions and his instructions have served as the major contributor towards
Then we would like to thank our parents and friends who have helped me with their
ls
valuable suggestions and guidance has been very helpful in various phases of the
ia
Last but not the least we would like to thanks our fellow mates who have helped us a lot.
t
Tu
CERTIFICATE
This is to certify that the software engineering project report entitled “Criminal Record
om
Management system (CRMS) is the work carried out by Rahul Gupta, Rahul Ray, Srishti
Gupta, Tanya Garg, student of B.Sc. (h) Computer Science, IV semester, Keshav
.c
Mahavidyalaya, University of Delhi under the supervision of TutorialsDuniya.Com.
ya
This report has not been submitted to any other organization / institution for the award of any
other degree/diploma.
i
un
Supervisor Teacher In-Charge
D
ls
TutorialsDuniya.Com TutorialsDuniya.Com
ia
or
Principal
t
Tu
TutorialsDuniya.Com
ABSTRACT
om
The main aim of the project is to develop a Criminal Record Management system. The project is
.c
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
ya
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
i
un
write data on the database. The authorized user could only read records from database. There will
TABLE OF CONTENT
om
1. SPECIFIC REQUIREMENT SOFTWARE ............................................................................... 1
1.1 INTRODUCTION:................................................................................................................ 1
.c
1.2 FEATURES:.......................................................................................................................... 1
1.3 PURPOSE: ............................................................................................................................ 1
ya
1.4 SCOPE: ................................................................................................................................. 1
1.5 DEFINITIONSAND ABBEREVIATIONS: ........................................................................ 1
1.6 OVERVIEW: ........................................................................................................................ 2
i
1.7 OVERALL DESCRIPTION: ................................................................................................ 2
un
1.8 PRODUCT PERSPECTIVE: ................................................................................................ 2
1.9 PRODUCT FUNCTIONS: .................................................................................................... 2
D
1.9.1) PROCESS DATA ......................................................................................................... 2
1.9.2) ADD USER ................................................................................................................... 3
ls
3. ARCHITECTURAL DESIGN.................................................................................................. 13
4. RISK ANALYSIS ..................................................................................................................... 15
4.1 COMPRISING LOGIN CREDENTIALS .......................................................................... 15
4.2 REGISTRATION RISK...................................................................................................... 15
om
4.3 RISK OF STORAGE OF DATABASE SPACE ................................................................ 15
4.4 RISK OF IMPROPERLY DENIED ACCESS ................................................................... 16
4.5 RISK OF LITIGATION EXPOSURE ................................................................................ 16
.c
5. PROJECT CODE ...................................................................................................................... 20
5.1 ANDROID CODE .............................................................................................................. 20
ya
5.2 PHP CODE ........................................................................................................................ 34
5.3 SCREEN SHOTS OF THE SOFTWARE .......................................................................... 38
i
6. TESTING .................................................................................................................................. 41
un
6.1 PSEUDO CODE ................................................................................................................. 41
6.2 CYCLOMATIC COMPLEXITY:....................................................................................... 42
6.2.1 TO FIND CYCLOMATIC COMPLEXITY ................................................................ 43
D
8. CONCLUSION ......................................................................................................................... 47
9. REFERENCES ......................................................................................................................... 48
t
Tu
TABLE OF FIGURES
om
FIGURE 1: DATA FLOW DIAGRAM LEVEL-0 .........................................................................5
FIGURE 2: DATA FLOW DIAGRAM LEVEL-1 .........................................................................6
FIGURE 3: GANTT CHART .......................................................................................................12
FIGURE 4: ARCHITECTURAL DESIGN ..................................................................................13
.c
FIGURE 5: ADMIN LOGIN PAGE .............................................................................................38
FIGURE 6: USER LOGIN PAGE ................................................................................................39
ya
FIGURE 7: ADD CRIMINAL PAGE ...........................................................................................40
FIGURE 8: CYCLOMATIC COMPLEXITY ..............................................................................42
FIGURE 9: USER MANUAL ......................................................................................................46
i
un
LIST OF TABLES
D
ls
om
1.1. INTRODUCTION
CRMS is an android application which is supported on all android versions above android
.c
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.
ya
1.2. FEATURES
CRMS is an android application which is supported on all android versions above android
i
un
KITKAT. This application enables two types of authentication, one is user authentication through
which user can view data of criminals from the database and other is the admin authentication
through which admin can add new users and add as well as modify criminal data.
D
1.3. PURPOSE
ls
This document aims to give a brief description about the Criminal Record Management System
Project. With the help of this document the needs of the police officers to get data of criminals
anytime will be completed with very ease.
ia
1.4. SCOPE
or
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
t
view the records of criminal. Only admin can make changes to database.
Tu
1.6. OVERVIEW
This SRS is organized in a way that any user of the organization can easily understand and use the
om
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
.c
document ends with the planning and estimating the basic schedule of our process.
ya
The overall description of our project can be stated as creating and managing the database,
developing a friendly user interface to manipulate the database, provide an authentication
mechanism to safely accomplish tasks mentioned above.
i
un
1.8. PRODUCT PERSPECTIVE
With the CRMS we will provide them with capabilities and properties organized neatly. CRMS
D
which is an android application will be used by police officers. Admin will basically query and
edit the database via CRMS. They will also add, update and delete data of criminals.
ls
CRMS implements some major functions in order to accomplish required tasks. These functions
constitute a basis for the whole system. These functions can be stated as:
or
These functions which can be examined in that process data major function are basically provides
t
admin to manage the database according to the desired task. These management tasks constitute
Tu
the major feature of the CRMS. With the help of these functions a admin can update some basic
data of criminals like address, Aadhar number etc. In addition to update data, a user can also search
the database in 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.
Registration of a user will not be as straight forward. It will not be in the users’ hand to register
om
himself. Only admin of the organization can add a new user by verifying all the details of the user
to be registered.
.c
There are two types of search processes in this application. One is by entering id of the criminal
and other is by image, i.e. by providing an image as input.
ya
1.10. CONSTRAINTS, ASSUMPTIONS AND DEPENDENCIES
Regularity Policies: Each user must be a police officer, jailor, CBI officer.
i
Hardware Limitations: Since CRMS is an android application, the operating system must be
un
ANDROID with version greater than ANDROID KITKAT. However, the CRMS system and the
database will work on a server that needs to be always online.
All the 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
ia
admin authentication page. From there admin can login. After login, admin will get three tabs as
follows:
or
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, Aadhar, etc.
t
Update data tab: his tab will enable the admin to update the record of the criminal in the database.
Tu
Delete data tab: This tab will enable the admin to delete records of a particular criminal from the
database. If the user sign 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.
In this section, we will explain the major functions of CRMS along with the data flow. So, the
om
major functionality of the project such as authentication mechanism, personal data processing,
recruitment, report, and graphical user interface unit will explain step by step.
Authentication: Login User can login to the CRMS system with his/her username and password.
Logout User can logout from the CRMS system.
.c
Login failure if the user does not exist in the database or the user did not get authorized by the
CRMS admin yet.
ya
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
i
alter the database. A normal user can search a criminal record but entering the id of the criminal
un
or by uploading an image to the application.
Performance requirement: The number of online users of the CRMS can be estimates as 50 at
ls
most. There is no restriction on the number of the users to be added to the databases.
Hardware Requirements: The CRMS application will be storing 500 criminals’ data which will
roughly requires 100 MB of database storage space.
require mobile handsets for the deployment of the project. To store and fetch the data to and from
Tu
the database online i.e. MySQL database on the localhost 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.
om
.c
Match Records Update Records
Criminal
ya
User Record Admin
Get Info Management Provide Security
i
un
D
om
Criminal
.c
Record
Table
ya
SEARCH
Operations
Criminal
Database
Data
i
un
Criminal Search
Record Query
User Admin
D
LOGIN
ls
Authenticate
ia
User
or
USER
Create User TABLE
SIGN UP
t
Tu
DATA DICTIONARY
om
DATA DICTIONARY
.c
Name Description
ya
User Credentials User Unique Id + Password.
i
Aadhaar Number + Password.
un
Criminal Record Criminal Name + Photo + Criminal Id + Crime + Fir
Number + Address + Aadhaar Number/Voter
Id/Permanent Account Number + Exile Period.
D
Get Info Photo/Criminal Id/Name.
om
GRADE
VALUE
1 Does the system require reliable backup and recovery? 5
Are specialized data communications required to transfer
2 3
information to or from the application?
.c
3 Are there distributed processing functions? 4
ya
4 Is performance critical? 0
Will the system run in an existing, heavily utilized
5 5
operational environment?
6
i
Does the system require on-line data entry? 5
un
Does the on-line data entry require the input transaction to be
7 3
built over multiple screens or operations?
8 Are the Master files updated online? 5
D
om
4-7 INPUTS AS AVERAGE
>7 INPUTS AS HIGH
Input
.c
FUNCTIONAL UNITS COMPLEXITY WEIGHING FACTOR
I1 AVERAGE 4
ya
I2 LOW 3
I3 AVERAGE 6
I4 LOW 3
i
un
I5 AVERAGE 6
TOTAL: 22
D
Output
ls
O1 AVERAGE 5
O2 AVERAGE 7
or
O3 AVERAGE 4
O4 AVERAGE 4
t
Tu
TOTAL: 20
ILF1 HIGH 7
om
ILF2 HIGH 15
ILF3 HIGH 15
.c
TOTAL: 37
ya
Enquires
FUNCTIONAL UNITS COMPLEXITY WEIGHING FACTOR
i
un
EQ1 HIGH 6
EQ2 HIGH 4
TOTAL: 10
D
ls
ia
t or
Tu
om
Now, COMPLEXITY ADJUSTMENT FACTOR (CAF) is:
CAF = 0.65 + (0.01 *∑ fi)
= 0.65 + (0.01 *3*14)
= 1.07
.c
So, The FUNCTIONAL POINT (FP) is:
FP = UFP*CAF
ya
= 95.23
i
Assuming that Average productivity for such a system is 6.5FP/pm i.e. 6.5 functional points per
un
person month, then the estimates are:
2.3. Scheduling
Scheduling is the culmination of a planning activity that is a primary component of Software
t
project management. When combined with estimation methods and risk analysis, scheduling
Tu
establishes a road map for the project manager. The characteristics of the project are used to adapt
an appropriate task set for the work to be done. A task network Depicts each engineering task, its
dependency on other tasks, and its projected duration.
om
.c
ya
FIGURE 3: GANTT CHART
i
un
D
ls
ia
t or
Tu
3. ARCHITECTURAL DESIGN
om
CRMS
.c
SIGN UP LOGIN SEARCH ADMIN
ya
AUTHENTICATE
CREATE USER COMPARE ADD DATA
USER
i
un
FIND DATA UPDATE DATA
D
ls
DELETE DATA
ia
The architectural design of the software defines every module of the application in detail in a
hierarchical way. The CRMS application is mainly divided into four modules:
t
Tu
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.
3. Search: This module helps the user to compare a criminal’s data to the whole database
and finding data of the required criminal.
om
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.
.c
i ya
un
D
ls
ia
t or
Tu
4. 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.
om
The biggest risk to our project is on the entry gate of the project i.e. the login page. If the login
credentials of the application are in wrong hands, either stolen or given by some fraud user, then
all the security of the application is breached. There is also the possibility that a hacker will by-
pass the login page to do some harmful function with our project.
.c
If this happens, then the person will exploit the criminal records and application in many ways as
listed below:
ya
1. He/she will take the personal details of the criminals.
2. He/she will take the project details which will result in the huge financial and legal lose to
the organization.
i
un
3. It will delete the database of the company which have an adverse effect on the working of
the organization.
There is a high probability of this risk to the organization if the user or admin lacks in the ethics.
D
In this risk, the organization has the risk of adding the unethical user into the database. The
potential risk under this are:
ia
1. Stealing of data
or
The probability of this risk is less as all the work of registration is done under the supervision of
t
Tu
the ADMIN.
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
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.
om
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.
.c
4.5. Risk of Litigation Exposure
ya
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.
i
un
D
ls
ia
t or
Tu
om
1.Size estimate is Product Size 40% 2
significantly low
.c
3.Less Reuse Product Size 20% 2
ya
Met Impact
6.Custom Requirement
i
Product Size 45% 3
un
Change
And
Experience
or
om
RISK ID : DATE: PROBABILITY : IMPACT:
R01 15-02-2018 20% 2
.c
DESCRIPTION:
Organizational Risk (Inconsistent data into tables)
ya
REFINEMENT/CONTEXT:
1. Inconsistency of data will lead to the formation spurious tuples in the database.
2. Incorrect information will be passed to the users.
MITIGATION/MONITIORING:
i
un
1. Correct data must be inserted into the database by the admin so that no spurious tuples are
formed.
2. Users can get the accurate information about the criminal.
D
MANAGEMENT/CONTIGENCY PLAN/TRIGGER:
1. Risk estimation computed to be 5000. Allocate the amount within project contingency cost.
ls
2. Develop, revise and schedule assuming that high capable server is to be adopted : allocate staff
accordingly.
ia
CURRENT STATUS :
05-03-2018: Mitigation steps initiated
t
Tu
TABLE 3: RMMM 1
om
DESCRIPTION:
Large number of users
.c
REFINEMENT/CONTEXT:
1. My Sql Database will give late response on large number of users.
2. Database can also crash sometimes.
ya
MITIGATION/MONITIORING:
1. Number of active users must be handled by the admin.
i
2. User must not be blocked by accessing data.
un
MANAGEMENT/CONTIGENCY PLAN/TRIGGER:
D
1. Risk estimation computed to be 5000. Allocate the amount within project contingency cost.
2. Develop, revise and schedule assuming that high capable server is to be adopted: allocate staff
accordingly.
ls
CURRENT STATUS :
05-03-2018: Mitigation steps initiated
or
TABLE 4: RMMM 2
5. PROJECT CODE
5.1. ANDROID CODE
om
5.1.1. ACTIVITIES
MAIN ACTIVITY
package com.example.rahul.crmsv2.Activities;
.c
import android.content.Context;
import android.content.DialogInterface;
ya
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.v7.app.AlertDialog;
i
import android.support.v7.app.AppCompatActivity;
un
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.util.Log;
import android.view.LayoutInflater;
D
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
ls
import com.example.rahul.crmsv2.Background.BackgroundLogin;
import com.example.rahul.crmsv2.R;
ia
EditText editText_username,editText_password;
CardView cardView_login;
TextView textView_admin;
t
@Override
Tu
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);
ConnectivityManager connectivityManager=(ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo=connectivityManager.getActiveNetworkInfo();
if (networkInfo!=null && networkInfo.isConnected())
{
textView_admin.setOnClickListener(new View.OnClickListener() {
om
@Override
public void onClick(View view) {
startActivity(new
Intent(getApplicationContext(),AdminAuthorizationActivity.class));
}
});
.c
cardView_login.setOnClickListener(new View.OnClickListener() {
@Override
ya
public void onClick(View view) {
String userName=editText_username.getText().toString();
String password=editText_password.getText().toString();
i
un
BackgroundLogin backgroundLogin=new BackgroundLogin(MainActivity.this);
backgroundLogin.execute(userName,password);
}
});
}
D
else
{
ls
}
or
builder.setMessage(msg)
Tu
}
}
ADMIN ACTIVITY
package com.example.rahul.crmsv2.Activities;
import android.content.DialogInterface;
om
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;
.c
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.support.v7.widget.Toolbar;
ya
import android.view.MenuItem;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.EditText;
import android.widget.TextView;
i
un
import com.example.rahul.crmsv2.Adapters.PagerViewAdapter;
import com.example.rahul.crmsv2.Background.BackgroundAddUser;
import com.example.rahul.crmsv2.R;
D
//SharedPreferences sharedPreferences;
@Override
or
addData=findViewById(R.id.addData);
Tu
updateData=findViewById(R.id.update);
delteData=findViewById(R.id.delete);
viewPager=findViewById(R.id.mainPager);
pagerViewAdapter=new PagerViewAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerViewAdapter);
addData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
viewPager.setCurrentItem(0);
}
});
om
updateData.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
viewPager.setCurrentItem(1);
}
});
.c
delteData.setOnClickListener(new View.OnClickListener() {
@Override
ya
public void onClick(View view) {
viewPager.setCurrentItem(2);
}
});
i
un
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
D
@Override
ls
changeTabs(position);
ia
@Override
or
}
t
});
Tu
updateData.setTextColor(getResources().getColor(R.color.textTabLight));
updateData.setTextSize(16);
delteData.setTextColor(getResources().getColor(R.color.textTabLight));
delteData.setTextSize(16);
om
if (position==1)
{
addData.setTextColor(getResources().getColor(R.color.textTabLight));
addData.setTextSize(16);
updateData.setTextColor(getResources().getColor(R.color.textTabBright));
.c
updateData.setTextSize(22);
delteData.setTextColor(getResources().getColor(R.color.textTabLight));
ya
delteData.setTextSize(16);
}
if (position==2)
{
i
addData.setTextColor(getResources().getColor(R.color.textTabLight));
un
addData.setTextSize(16);
updateData.setTextColor(getResources().getColor(R.color.textTabLight));
updateData.setTextSize(16);
D
delteData.setTextColor(getResources().getColor(R.color.textTabBright));
delteData.setTextSize(22);
ls
}
}
}
ia
5.1.2. BACKGROUND
or
BACKGROUND LOGIN
package com.example.rahul.crmsv2.Background;
t
import android.app.AlertDialog;
Tu
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;
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;
om
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
.c
* Created by rahul on 22/3/18.
*/
ya
public class BackgroundLogin extends AsyncTask<String, Void, String> {
Context context;
ProgressDialog progressDialog;
i
un
public BackgroundLogin(Context context) {
this.context = context;
progressDialog=new ProgressDialog(context);
}
D
@Override
protected void onPreExecute() {
ls
// super.onPreExecute();
progressDialog.setProgressStyle(R.style.Theme_AppCompat_DayNight_DarkActionBar);
progressDialog.setCancelable(false);
ia
progressDialog.setIndeterminate(true);
progressDialog.setMessage("Logging in..");
progressDialog.show();
}
or
@Override
protected String doInBackground(String... voids) {
t
Tu
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 {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
try {
URL url=new URL(loginUrl);
om
HttpURLConnection httpURLConnection=(HttpURLConnection)url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
OutputStream outputStream=httpURLConnection.getOutputStream();
BufferedWriter bufferedWriter=new BufferedWriter(new
OutputStreamWriter(outputStream,"UTF-8"));
.c
String loginData= URLEncoder.encode("userName","UTF-
8")+"="+URLEncoder.encode(userName,"UTF-8")+"&"+
URLEncoder.encode("password","UTF-
ya
8")+"="+URLEncoder.encode(password,"UTF-8");
bufferedWriter.write(loginData);
bufferedWriter.flush();
bufferedWriter.close();
outputStream.close();
i
un
InputStream inputStream=httpURLConnection.getInputStream();
BufferedReader bufferedReader=new BufferedReader(new
InputStreamReader(inputStream,"UTF-8"));
String response="";
D
String line="";
while((line=bufferedReader.readLine())!=null)
ls
{
response+=line;
}
ia
bufferedReader.close();
inputStream.close();
httpURLConnection.disconnect();
or
return response;
} catch (MalformedURLException e) {
e.printStackTrace();
t
} catch (IOException e) {
Tu
e.printStackTrace();
}
return null;
}
@Override
protected void onProgressUpdate(Void... values) {
super.onProgressUpdate(values);
}
@Override
protected void onPostExecute(String aVoid) {
// super.onPostExecute(aVoid);
progressDialog.dismiss();
om
AlertDialog.Builder builder=new AlertDialog.Builder(context);
builder.setMessage(aVoid)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
.c
dialogInterface.cancel();
}
});
ya
AlertDialog alertDialog=builder.create();
alertDialog.show();
}
}
i
un
BACKGROUND ADD CRIMINAL
package com.example.rahul.crmsv2.Background;
D
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
ls
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.widget.Toast;
ia
import com.example.rahul.crmsv2.R;
or
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
t
import java.io.InputStreamReader;
Tu
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
/**
Context context;
ProgressDialog progressDialog;
om
String addUserUrl;
.c
@Override
protected void onPreExecute() {
ya
// super.onPreExecute();
// progressDialog.setProgressStyle(R.style.Theme_AppCompat_DayNight_DarkActionBar);
// progressDialog.setCancelable(false);
// progressDialog.setIndeterminate(true);
//
i
progressDialog.setMessage("Signing Up..");
un
// progressDialog.show();
// new Handler().postDelayed(new Runnable() {
// @Override
// public void run() {
// progressDialog.dismiss();
D
// }
// },3000);
ls
@Override
ia
String addUserUrl="http://192.168.43.92/CRMSV2/addCriminal.php";
or
String name=voids[0];
String crime=voids[1];
String addr=voids[2];
t
String phone=voids[3];
Tu
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();
// }
try {
URL url=new URL(addUserUrl);
HttpURLConnection httpURLConnection=(HttpURLConnection) url.openConnection();
httpURLConnection.setRequestMethod("POST");
httpURLConnection.setDoOutput(true);
om
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-
.c
8")+"&"+
URLEncoder.encode("addr","UTF-8")+"="+URLEncoder.encode(addr,"UTF-
8")+"&"+
ya
URLEncoder.encode("phone","UTF-8")+"="+URLEncoder.encode(phone,"UTF-
8")+"&"+
URLEncoder.encode("rel","UTF-8")+"="+URLEncoder.encode(rel,"UTF-8")+"&"+
URLEncoder.encode("arrstDate","UTF-
i
8")+"="+URLEncoder.encode(arrstDate,"UTF-8")+"&"+
un
URLEncoder.encode("aadhar","UTF-8")+"="+URLEncoder.encode(aadhar,"UTF-
8");
bufferedWriter.write(userData);
bufferedWriter.flush();
bufferedWriter.close();
D
outputStream.close();
ls
InputStream inputStream=httpURLConnection.getInputStream();
InputStreamReader(inputStream,"UTF-8"));
String response="";
String line="";
while((line=bufferedReader.readLine())!=null)
or
{
response+=line;
}
t
bufferedReader.close();
Tu
inputStream.close();
httpURLConnection.disconnect();
return response;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onProgressUpdate(Void... values) {
om
// super.onProgressUpdate(values);
.c
@Override
protected void onPostExecute(String aVoid) {
ya
super.onPostExecute(aVoid);
Toast.makeText(context,aVoid,Toast.LENGTH_LONG).show();
}
i
un
5.1.3. ADAPTERS
package com.example.rahul.crmsv2.Adapters;
ls
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
ia
import com.example.rahul.crmsv2.Fragments.AddDataFragment;
import com.example.rahul.crmsv2.Fragments.DeleteDataFragment;
or
import com.example.rahul.crmsv2.Fragments.UpdateFragment;
/**
* Created by rahul on 3/4/18.
t
*/
Tu
@Override
om
case 2:
return new DeleteDataFragment();
default:
return null;
}
.c
}
@Override
ya
public int getCount() {
return 3;
}
}
i
un
5.1.4. FRAGMENTS
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
ia
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.app.Fragment;
or
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
t
import android.widget.EditText;
Tu
import android.widget.Toast;
import com.example.rahul.crmsv2.Background.AddCriminal;
import com.example.rahul.crmsv2.Background.UploadImage;
import com.example.rahul.crmsv2.R;
import java.io.IOException;
import de.hdodenhof.circleimageview.CircleImageView;
/**
* A simple {@link Fragment} subclass.
*/
public class AddDataFragment extends Fragment {
om
EditText name, crime, addr, phone, rel, arrstDate, aadhar;
Button submit;
CircleImageView image;
private static final int PICK_IMAGE = 1;
Uri imageUri;
.c
Bitmap bitmap;
public AddDataFragment() {
ya
// Required empty public constructor
}
@Override
i
un
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);
D
crime=view.findViewById(R.id.crimeCriminal);
addr=view.findViewById(R.id.addrCriminal);
ls
phone=view.findViewById(R.id.phoneCriminal);
rel=view.findViewById(R.id.relCriminal);
arrstDate=view.findViewById(R.id.arrstDateCriminal);
ia
aadhar=view.findViewById(R.id.aadharCriminal);
submit=view.findViewById(R.id.btnSubmit);
image=view.findViewById(R.id.imageCriminal);
or
image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
t
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) {
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();
om
if (Name.isEmpty() || Crime.isEmpty() ||Addr.isEmpty() ||Phone.isEmpty()
||Rel.isEmpty() ||ArrstDate.isEmpty() ||Aadhar.isEmpty())
{
Toast.makeText(getActivity().getApplicationContext(),"Every field must be
filled",Toast.LENGTH_LONG).show();
.c
}
else
{
ya
AddCriminal addCriminal=new
AddCriminal(getActivity().getApplicationContext());
addCriminal.execute(Name,Crime,Addr,Phone,Rel,ArrstDate,Aadhar);
name.setText("");
i
un
crime.setText("");
addr.setText("");
phone.setText("");
rel.setText("");
arrstDate.setText("");
D
aadhar.setText("");
}
ls
}
});
ia
return view;
}
or
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
t
Tu
if (requestCode==PICK_IMAGE)
{
imageUri=data.getData();
try {
bitmap=
MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(),imageUri);
image.setImageBitmap(bitmap);
uploadImage.execute(bitmap);
} catch (IOException e) {
e.printStackTrace();
}
}
}
om
}
.c
5.2. PHP CODE
ya
ADD CRIMINAL
<?php
include 'init.php';
i
un
$name=$_POST["name"];
$crime=$_POST["crime"];
$addr=$_POST["addr"];
$phone=$_POST["phone"];
D
$rel=$_POST["rel"];
$arrstDate=$_POST["arrstDate"];
ls
$aadhar=$_POST["aadhar"];
$sql="insert into criminal (cName, cCrime, cAddress, cPhone, cRelative, cArrestDate, Aadhar)
ia
if ($res) {
echo "Data added successfully..";
}
else
t
{
Tu
?>
ADD USER
<?php
include 'init.php';
$name=$_POST["name"];
$userName=$_POST["userName"];
$Password=$_POST["Password"];
$DOB=$_POST["DOB"];
om
$phone=$_POST["phone"];
$email=$_POST["email"];
$Designation=$_POST["Designation"];
$Aadhar=$_POST["Aadhar"];
.c
$result=mysqli_query($conn,$sql);
$resultCheck=mysqli_num_rows($result);
ya
if ($resultCheck>0) {
echo "User Already Exits..";
}
else
i
un
{
$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);
D
$resultCheck=mysqli_num_rows($result);
echo "Registeration Success..";
ls
// echo "<pre>";
ia
// var_dump($GLOBALS);
// echo "</pre>";
?>
or
LOGIN
t
<?php
Tu
include 'init.php';
$userName=$_POST["userName"];
$password=$_POST["password"];
$resultCheck=mysqli_num_rows($result);
om
if ($resultCheck==1) {
echo "Logged In Suucessful..";
}
else
{
if ($resultCheck==0) {
.c
echo "Authentication failed..";
}
else
ya
{
echo "Error in Authentication..";
}
}
?>
i
un
UPLOAD IMAGE
<?php
include 'init.php';
D
$image=$_POST["image"];
ls
//var_dump($image);
ia
$res = mysqli_query($conn,$sql);
or
$id = 0;
while($row = mysqli_fetch_array($res)){
t
$id = $row['id'];
Tu
$path = "uploads/$id.jpg";
$imageName="$id.jpg";
$actualpath = "http://localhost/CRMSV2/$path";
if(mysqli_query($conn,$sql)){
file_put_contents($path,base64_decode($image));
// echo "$path<br>";
// echo "base64_decode($image)<br>";
echo "Successfully Uploaded";
}
om
else
{
echo "Error in uploading image";
}
?>
.c
i ya
un
D
ls
ia
t or
Tu
om
.c
i ya
un
D
ls
ia
t or
Tu
om
.c
i ya
un
D
ls
ia
t or
Tu
om
.c
i ya
un
D
ls
ia
t or
Tu
6. TESTING
om
1. <?php
2. include 'init.php';
.c
3. $userName=$_POST["userName"];
4. $password=$_POST["password"];
ya
5. $sql="select * from users where uEmail='$userName' and uPassword='$password';";
6. $result=mysqli_query($conn,$sql);
i
7. $resultCheck=mysqli_num_rows($result);
un
8. if ($resultCheck==1) {
10. else
ls
13. else{
or
15. }
t
16.?>
Tu
om
2
.c
4
ya
5
i
un
6
D
7
R3
ls
8
10
ia
9
or
13
R1 11 R2
t
Tu
12
16 14
15
om
conducted to ensure that all statements have been executed at least once.
(a) C = e - n +2, where e = number of edges, n = number of nodes
e = 17
n = 16
.c
C = 17 – 16 + 2
C=3
ya
(b) C = number of regions
C=3
(c) C=p+1 i
un
C = 2 + c (8th and 11th node)
1 – 8, 10 – 16
1 – 8, 10, 11, 13 – 16
ia
t or
Tu
1. (1 - 8, 9, 16)
Input: Username, Password
If username and password correct (1-8), 9, 16
om
2. (1 - 8, 10 - 16)
Input: Username, password
If username or password incorrect (1-8), (10-16)
.c
Input: username, password
If username or password incorrect on any server error (1-8), 10, 11, (13-16)
i ya
un
D
ls
ia
t or
Tu
7. USER MANUAL
The CRMS software is an android application. Following are the requirement for the proper
deployment of the software:
1. An android mobile phone is required.
om
2. The mobile phones must run on android 4.4 or higher version.
3. It has at least 250 MB of RAM and a 20 Mb of the hard disk space.
4. It must have an active internet connection for the smooth functioning of the software.
.c
In this section of the project, the user has to login with the credentials provided to him/her by
ya
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
i
provide the login details of the user to him/her so that any other outsider will not violate the
un
security of the application.
D
ls
ia
t or
Tu
om
.c
i ya
un
D
ls
ia
or
FIGURE 9
Users can logout from his/her id at any time using the logout tab at the top right corner of the
t
home page.
Tu
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.
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
om
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.
.c
There are some benefits of implementing CRMS:
ya
1. The CRMS provides uniformity through templates and predetermined procedures for
uploading data and downloading reports. It also means that data retrieved and viewed
i
is in a format that is easily identifiable and user friendly.
un
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.
D
Lastly, we enjoy this subject that can make me understand about criminal record
management system. We can use this knowledge for our future.
ls
ia
t or
Tu
9. REFERENCES
1. The successful completion of this project has been achieved by the assistance from
om
various Resources which includes:
2. https://www.tutorialsduniya.com
3. Software Engineering: A Practitioner’s Approach by Roger
.c
4. S.Pressman An Integrated Approach to Software Engineering by
ya
P.Jalote
6. https://www.tutorialsduniya.com i
un
D
ls
ia
t or
Tu