You are on page 1of 57

MAKERERE UNIVERSITY

MAKERERE UNIVERSITY BUSINESS SCHOOL


FACULTY OF COMPUTING AND INFORMATICS

DEVELOPING A COMMUNITY POLICING MOBILE APPLICATION FOR


UGANDA POLICE FORCE

BY

NAME REGISTRATION NUMBER PROGRAM CONTACT

Wilfred OYOO 16/U/17600/PS BBC +256 771 335949

Diana NABUKWASI 16/U/18535/PS BBC +256 759 604786

Joel GONAHASA 16/U/13824/PS BBC +256 759 860289

Allen BABIRYE 16/U/13419/EVE BBC +256 786 354322

Mudasiri ALEMA 13/U/2184/PS BBC +256 783 213232

Gloria NANDUTU 16/U/16700/EVE BBC +256 783 580291

SUPERVISOR

PROF JOSEPH K SSEWANYANA

DEPARTMENT OF APPLIED COMPUTING AND INFORMATION TECHNOLOGY

A PROJECT REPORT SUBMITTED TO MAKERERE UNIVERSITY BUSINESS


SCHOOL IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE
AWARD OF THE DEGREE OF BACHELOR OF BUSINESS COMPUTING
OF MAKERERE UNIVERSITY

APRIL, 2019
i
ii
DEDICATION

We dedicate this piece of work to our parents, guidance and benefactors. It is all as the result of
your support, motivation. May God bless you abundantly.

iii
ACKNOWLEDGEMENT

We would like to appreciate everyone who gave us a hand both directly and indirectly towards
this successful completion of the final year project.

Our humble regards go to the overall staff body of Makerere University Business School who
worked tirelessly as a team to support us towards achievement of applicable skills during the
three year course and the final year project.

Our special appreciation goes to our dear supervisor Prof. Joseph K Ssewanyana for guidance
and motivation throughout the project.

Utmost gratitude goes to the team members who injected a great deal of resources in the project
for sure without the team, the research could not have been possible, all stakeholders who
invested their precious time. Great appreciation goes to the team coordinator Mudasiri Alema for
the courage and motivation throughout this research project. We would also like to recognize
other participants like Diana Nabukwasi, Allen Babirye, Gloria Nandutu and Joel Gonahasa for
the countless efforts towards the project. Our humble regards go to the team leader Wilfred Oyo
for the perseverance and efforts toward the project.

In a special way, we would like to thank our parents, guidance and benefactors for the tireless
support and endurance till this point. For sure we are humbled.

Finally, we would like to give a heartfelt appreciation to the Almighty God for making this
academic year a success and specifically this project not forgetting the protection he rendered to
not only the us but also our benefactors, friends, colleagues and supervisor. Thank you so much.

iv
TABLE OF CONTENTS

DECLARATION ___________________________________Error! Bookmark not defined.


APPROVAL _______________________________________Error! Bookmark not defined.
DEDICATION _____________________________________________________________ ii
ACKNOWLEDGEMENT ____________________________________________________ iv
LIST OF FIGURES _________________________________________________________ viii
LIST OF TABLES __________________________________________________________ ix
ACRONYMS ______________________________________________________________ x
ABSTRACT _______________________________________________________________ xi
CHAPTER ONE ____________________________________________________________ 1
1.0 Introduction _____________________________________________________________ 1
1.1 Background of the study ___________________________________________________ 1
1.2 Problem statement ________________________________________________________ 2
1.3 General objective of study__________________________________________________ 3
1.4 Specific objectives of the study______________________________________________ 3
1.5 Scope of the study ________________________________________________________ 3
1.5.1 Subject scope __________________________________________________________ 3
1.5.2 Geographical scope _____________________________________________________ 4
1.6Significance of the study ___________________________________________________ 4
CHAPTER TWO____________________________________________________________ 5
LITERATURE REVIEW _____________________________________________________ 5
2.1 Introduction to Community policing __________________________________________ 5
2.2 Previous studies on crime rates ______________________________________________ 5
2.3 Review of existing system crime reporting systems ______________________________ 8
2.4 Weaknesses of the existing system __________________________________________ 10
CHAPTER THREE _________________________________________________________ 12
METHODOLOGY _________________________________________________________ 12
3.0 Introduction ____________________________________________________________ 12
3.1 Research Design ________________________________________________________ 12
3.2 Sources of data _________________________________________________________ 12
3.3Study sample ___________________________________________________________ 12
3.4 Systems Development Life cycle approach ___________________________________ 13

v
3.5 Requirement Elicitation Techniques _________________________________________ 13
3.5.1 Questionnaire _________________________________________________________ 13
3.5.2 Observation __________________________________________________________ 14
3.5.3 Interviews ____________________________________________________________ 14
3.6 Ethical Considerations____________________________________________________ 14
3.7 System Requirements specifications (SRS) ___________________________________ 15
3.7.1 User requirements _____________________________________________________ 15
3.7.2 System requirements ___________________________________________________ 15
3.7.3 Functional requirements _________________________________________________ 15
3.7.4 Non-functional requirements _____________________________________________ 15
3.8 System Design Approach _________________________________________________ 15
3.9 Systems Testing_________________________________________________________ 15
3.10 Systems Implementation _________________________________________________ 16
CHAPTER FOUR __________________________________________________________ 17
SYSTEM ANALYSIS AND DESIGN __________________________________________ 17
4.0 Introduction ____________________________________________________________ 17
4.1 Requirement Specification ________________________________________________ 17
4.1.1 Functional requirements _________________________________________________ 17
4.1.2 Non-functional requirements _____________________________________________ 18
4.1.3 System Requirements ___________________________________________________ 20
4.1.4 User requirements _____________________________________________________ 20
4.2 System design __________________________________________________________ 20
4.2.1 Structural/ Procedural design _____________________________________________ 21
4.2.1.1 Flowchart diagram____________________________________________________ 21
4.2.2 Object Oriented Design _________________________________________________ 22
4.3 System Testing _______________________________________________________ 23
CHAPTER FIVE ___________________________________________________________ 24
SYSTEM DEVELOPMENT__________________________________________________ 24
5.0 Introduction ____________________________________________________________ 24
5.1 System development _____________________________________________________ 24
5.2 System implementation ___________________________________________________ 24
5.2.1 Login UI _____________________________________________________________ 24
5.2.2 Home UI _____________________________________________________________ 26
vi
5.2.3 Report crime UI _______________________________________________________ 27
5.2.2 Sample implementation code _____________________________________________ 28
5.2.2.1 Login verification code. _______________________________________________ 28
CHAPTER SIX ____________________________________________________________ 29
CONCLUSION AND RECOMMENDATION ___________________________________ 29
6.0 Introduction ____________________________________________________________ 29
6.1 Conclusion_____________________________________________________________ 29
6.2 Recommendations _______________________________________________________ 30
6.3 Limitations ____________________________________________________________ 31
6.4 Future work ____________________________________________________________ 31
REFERENCES ____________________________________________________________ 33
APPENDICES _____________________________________________________________ 35
Appendix I: Sample implementation code _______________________________________ 35
Appendix II: Project Time framework __________________________________________ 42
Appendix III: Budget _______________________________________________________ 42
Appendix IV: Questionnaire __________________________________________________ 43
Appendix V: Interview questions ______________________________________________ 45

vii
LIST OF FIGURES
Figure 1: Flowchart diagram for the application ......................................................................... 21
Figure 2: iWatchUG use case diagram ........................................................................................ 22
Figure 3: Login User Interface ..................................................................................................... 25
Figure 4: Home User Interface .................................................................................................... 26
Figure 5: Report crime UI ............................................................................................................ 27

viii
LIST OF TABLES
Table 1: Functional requirements on the reporter‟s end .............................................................. 18
Table 2: Functional requirements on the police officer‟s end ..................................................... 18
Table 3: Non-functional requirements ......................................................................................... 19

ix
ACRONYMS

API Application Program Interface


CPI Corruption Perception Index
CPOs Community Police Officers
CTS Crime Trend Survey
DALYs Disability Adjusted Life Years
DNA Deoxyribonucleic acid
DPC District Police Commander
GIS Geographic information system
GPS Geographical Positioning System
IDE Integrated Development Environment
OCD Organized Crime Division
OCS Officer Commanding Station
OOD Object Oriented Design
RAD Rapid Application Development
SDLC System Development Life Cycle
SRS System Requirement Specification
UI User Interface
UN United Nations
GUI Graphical User Interface
UNODC United Nations Office on Drugs and Crime
UPC Uganda Peoples‟ Congress
UPF Uganda Police Force
UX User experience
XML Extensible Mark-up Language

x
ABSTRACT

Security and crime related issues have become rampant most urban areas across the world. The
application of technology can be incorporated into the security systems to enhance operational
measures that have been deployed in the fight against crime.

The aim of this study research was to examine the challenges stakeholders face in crime
reporting and develop a mobile-based application that would support intelligence information
and real-time reporting. The study employed a number of requirement elicitation techniques to
develop the proposed mobile application. Primary data was gathered from members of the public
and police officers serving within Nakawa division, Kampala. The survey design made use of
structured questionnaires which were administered to respondents independently, followed by
developing a mobile application aimed at sealing the loopholes identified.

Consequently, the application was tested for usability by both the public and police officers. The
test was successful and all key operation tests had positive and acceptable outcomes. The study
therefore indicated that, the current crime reporting method has numerous failure, which is
associated with late response to criminal cases, inaccuracy in documentation of acts, non-
coordinate specific response by the police, longer duration for response, hence slow or no
resolution of issues raised by the public and human resource related issues such as bribes before
the police can act on reported cases.

The viability of the phone-based reporting was justified by the presence of more than half (85%)
of the sampled population owning and being able to use smartphone which would support the
application. The findings of the study concluded that the current crime reporting and information
collection system are part of the problem that negates the policing sector hence encouraging
criminal acts.

Finally, the study recommends that if the application will be used by the sector, then it is highly
required for police officers to conduct training on the usage and massive education and
awareness to the public as it presents a viable tool for solving crime, improving intelligence
collection and reducing resource waste in the entire policing value chain.

xi
CHAPTER ONE

1.0 Introduction
Crime causes social, economic, health, and psychological effects on victims and the community
they live. It is a serious social problem that directly reduces the quality of life in the community
and the country at large. Many conceive a community as a geographic area and others take a
community as an area of common life but according to UN office on drugs and crime, a
community refers to small neighborhoods, areas within a city, or small villages or towns.

1.1 Background of the study


The Uganda Police Force is a state owned body which was initially established under the Uganda
Armed Constabulary in 1899. The institution has undergone an extensive metamorphosis since
its early beginnings. The current UPF was established under Article 212 of the 1995 constitution
of the Republic of Uganda. It is charged with advancement and enhancement of peace, stability,
order and adherence to the rule law.

Over the years, the operational strategies of the UPF became almost entirely reactive, taking
complaints, conducting investigations and recording statements, with little personal interaction.
As Uganda passed through political turmoil during the 1970s and 1980s the allegations of
incompetence, brutality and corruption badly tarnished the UPF‟s image, and led to great fear
and mistrust by the public. The report of the Commission of Enquiry into the Violation of
Human Rights in Uganda from 1962 to January 1986, pointed out that the UPF was one of the
state agencies implicated in atrocities during the Idi Amin military junta era and the second
Uganda Peoples‟ Congress (UPC) Obote government 1980-1985. For some time afterwards, the
resulting fear and mistrust discouraged the public from supporting the police and working
together in a partnership against crime. These attitudes have steadily been changing in recent
years with improved police discipline and performance. The UPF itself, however has made little
systematic attempt to market its image and solicit public support.

Traditionally, the maintenance of law and order in any community has usually been the exclusive
role of conventional police and other law enforcement agents in the absence of active
participation of the wider members of the community. Therefore, the UPF has tended to see
members of the public‟s role exclusively in terms of the help they can provide in the combat and
1
prevention of crime and has for some time been pursuing strategies aimed at promoting a
partnership against it. The focus has been on sensitizing the public on their role and what they
can do to contain crime. There has been much less emphasis on listening to public priorities and
concerns.

Community policing was introduced in Uganda in 1989 by the District Police Commander
(DPC) of Old Kampala Police Division. The initiative assumed significance as a pilot project in
response to conflict between different community groups and increased instances of theft of
electrical items. The community criticized the performance of the police, whom they accused of
incompetence, indifference and corruption. The conflict assumed political overtones and the
DPC initiated a public relations campaign. Four British Police Officers who were conducting
training courses in the Country at that time, together with the DPC, Pauline Bangirana,
introduced the idea of sensitizing the public, offering crime prevention advice and property
marking. The Community Police Officers (CPOs) were provided with bicycles to enable them to
“mobilize the community”. In addition to their work as mobilizers, the CPOs operated as beat
officers and, in discharging their beat duties, they were to interact with the public and discuss
with them issues related to crime, security and welfare. This initiative faltered when the
divisional head was transferred.

Therefore to successfully reduce crime, there must be an active community partnership and
involvement using a convenient and portable android mobile application so that crime reporting
and updates are done anonymously and the nearest police station from the crime scene are
alerted and immediate actions undertaken.

1.2 Problem statement


Uganda has for the last couple of months been on the spotlight for the upsurge in criminal
activities not until recently that the President Yoweri Museveni revealed a nine point master plan
that includes the collection of DNA of all Ugandans among other remedies besides his 2011 –
2016 manifesto which advocates for community support in keeping the nation safe. According to
the annual crime report (2017) by the UPF, there was a 3.3% increase in the crime rate across the
country with over 252,065 cases registered in 2017 compared to that of the previous year of
243,988 cases.

2
However, based on the report some of the crime categories include breakings, thefts, terrorism,
robbery, sex related crimes, vandalism among others. These criminal activities are impacting the
country with a lot of negative implications which reduces the quality of life socially, politically
and economically.

In order to address the rising crime rates in Uganda, it is important to have a convenient and
portable mobile application in place to reduce crime.

1.3 General objective of study


The main objective of the study is to develop a mobile application which will help bridge the gap
between the community and the police in a collective partnership in reducing crime rates in
community.

1.4 Specific objectives of the study


To clearly analyse the current crime reporting system adopted by the Uganda Police Force in
keeping track on law, order and crime prevention within the country.

To establish the requirements necessary for designing a community policing mobile application
for Uganda Police Force.

To design a community policing mobile application for Uganda Police Force.

To develop a community policing mobile application for Uganda Police Force.

To test the community policing mobile application developed for the Uganda Police Force.

1.5 Scope of the study


This sub-section basically dictates the boundary of the study and is mainly categorized into;

1.5.1 Subject scope


This briefly defines the boundary of the research in terms of the functionality and scope of
investigation.

This research will be concentrated on the crime management and find out how best can the
community partner with the Police force in keeping an eye on the security and order around them
through submitting anonymous crime reports with the help of the mobile-based application.

3
1.5.2 Geographical scope
Geographical scope defines the physical boundary of the research and also outlines why a
particular area was zeroed down.

This study research will be conducted mainly in the central region of Kampala. This is because
of the ease of access and the cheaper transport costs and time compared to longer distances from
our campus and due to the frequent reports about the insecurity within the region.

1.6Significance of the study


The goals of community policy among others are to help reduce citizen fear of crime, improve
police-community relations, facilitate more effective responses to community and lower the
overall amount of crimes committed. Therefore this project upon completion and implementation
should be in position to solve the challenges in the following ways;

This project should improve the administrative efficiency in crime prevention by creating strong
alliances between the police and the community against crime with a collective support from the
citizens within the communities they live.

This study should serve as a reference for anyone who might wish to develop or improve a
community policing application

The research study should enable students gain experience in UI and UX design, business logic
development plus database design and management.

To the policy makers for instance the Government of Uganda, should be able to understand the
benefits of involving the community in partnership with the Police forces in crime management.

4
CHAPTER TWO
LITERATURE REVIEW

2.1 Introduction to Community policing


There are a number of definitions which give a hint on community policing but all appear to have
a major keywords in them i.e.; police-community partnerships, a problem-solving approach and
organizational decentralization as stated by Oliver (1998) definition seems most comprehensive.
The policy emerging due to the fact that police alone cannot be able to solve all problems within
the communities. Therefore, building partnership between members of community and police
towards crime prevention is inevitable. According to Ferreira (1996), community policing is a
philosophy of full service personalized policing, where the same officer patrols and works in the
same area on a permanent basis, from a decentralized place, working in a proactive partnership
with citizens to identify and solve problems."
Crime is an illegal act which causes physical or moral injuries on other individuals.
We are all used to accessing task-specific mobile apps to accomplish our business on the go.
Law enforcement agencies has caught onto this trend too and now mobile apps are the core of
fieldwork, improving community safety through police-community partnership, investigations
and more.

2.2 Previous studies on crime rates


Over the years, a number of countries have encountered numerous challenges related to crime
which brought about engagement between the residents and their local law enforcement agencies
mainly the Police forces in battle such crimes to make their community safe. Below are some of
the crime statistics around the world.
When we consider the crime pattern in most developing and developed countries around the
world. Muhammad et al (2014) stated in his journal that in Malaysia, a ten year from 2004 - 2013
archival analysis presented that a total number of 314,675 violent crime incidents were recorded.
In general, violent crimes undertook a fluctuating pattern. Basing on the same reports, the year
2009 recorded the highest number of violent crime incidents of about 42,365 cases followed by
2008 with cases striving at 35,159.

5
In the Philippines, reports on criminal activities have been fluctuating in the last five years with
statistics of 80,108 registered in 2000, 76,991 in 2001, 85,776 cases in 2002 and 83,704 cases
reported in 2003. Looking at the period of January to November 2004, the total crime cases
registered is 8.5% lower compared with the same period the previous year. Out of the crime
statistics, 55% are index crimes and the rest too form of non-index crimes. According to Alexis
(n.d.), most of the crimes committed in the Philippines are street crimes, drug trafficking, violent
crimes against women and children, terrorism and smuggling and trafficking in human.

According to Bayley & David (n.d.), the period ranging from 1960s to early 1990s in Japan, the
crime rate remained stable and at a low level, with the number of recorded penal code crimes
being approximately 1.5 million cases per year. Considering the year 1991 however, this
situation changed, with the rate of recorded penal code crimes rising above 1 .7 million for the
first time, and then accelerating above 2 million in 1998. There was financial crisis followed by
other increase in crime, with penal code crimes at approximately 2.85 million in 2002, which
was the highest statistics on crime ever recorded. Overall, the increase in the crime rate during
the five year period between 1998 and 2002 was astonishingly at a rate of 40.3 % according to
Taisuke (n.d.).

Next we put emphasis on South America and the Caribbean Countries. Blum and Ireland (2004)
postulated that in Caribbean, murder rates are estimated to be at 30 per 100,000 population
annually are higher than for any other region of the world and have risen in recent years for
many of the region„s countries. Basing on the assault statistics reported to police, are also
significantly above the world average. Victimization surveys were some of the tasks needed to
approximate the true statistics of assault, yet standardized victimization surveys have rarely been
conducted in the Caribbean. Violence against women affects a large percentage of women and
girls in the Caribbean. According to Halcon et al (2003), one such regional victimization survey
revealed that 48 percent of adolescent girl„s sexual initiation was forced‖ or somewhat forced in
nine Caribbean countries. The United Nations Office on Drugs and Crime‟s Trends Survey
(CTS) which is based on police statistics, three of the top ten recorded rape rates in the world
occur in the Caribbean.

6
All states in the Caribbean for which comparable data are available for instance Bahamas, St.
Vincent and the Grenadines, Jamaica, St. Kitts and Nevis, Dominica, Barbados, and Trinidad and
Tobago have experienced significant rate of rape above the un weighted average of the 102
countries in the CTS. Despite their diversity, one unique thing all Caribbean countries have in
common is that they have long been caught in the crossfire of international drug trafficking.
In spite the fact that there are shifts in the crime levels, large quantities of drugs continue to
move out of the Caribbean. In 2005 according to the Central Statistical Office (2006) reports, it
is estimated that about 10 tons of cocaine transited through Jamaica, and approximated volume
of 20 tons was through Haiti and the Dominican Republic. Besides drug trafficking, kidnapping
and corruption are other forms of organized crime which greatly affects the region. Two
countries Haiti and Trinidad and Tobago have recently encountered a rapid increase in
kidnappings.

Looking at the statistics of Central Statistics Office of Trinidad and Tobago (2006), the
kidnapping rate nearly doubled in Trinidad and Tobago between 1999 and 2005. Corruption is
the most challenging crime to measure while there are methodological concerns about
Transparency International„s Corruption Perceptions Index (CPI), it remains the standard for
international corruption comparisons and boasts in one of the few datasets with near global
coverage.
Considering the 2006 CPI by Transparency International, ten Caribbean countries were included
in the world rankings. Haiti was considered as the most corrupt country in the world, while
Barbados was ranked as the 24th least corrupt country, ahead of many European countries.

Latin America had the highest violent crime rates in the world. Of the 520,000 homicides
committed world-wide in 2000, 140,000 were in this region argued Sudhir and Kara (n.d.). The
homicide rate was at 27.5 per one hundred thousand inhabitants, is triple the world average of
that year. Even taking into consideration the records on gender violence in these countries, the
death rates are much higher among the male population, 51 homicides per one hundred thousand
inhabitants. Statistics showed that the homicide rate among the male population mainly between
15 and 29 years old is 89.7 per one hundred thousand inhabitants. In view of these figures, it was

7
not surprising that homicide was the fifth leading cause of death in the region. Furthermore,
interpersonal violence is the third cause of loss of disability-adjusted life years (DALYs).

Zeroing down to Africa with focus on Nigeria, political and business crime rate is on the increase
almost on a daily basis. According to the Disability, poverty and development report (2014), the
Nigerian crime problem is multidimensional and is capable of undermining its corporate
existence as well as efforts towards sustainable development. The country‟s concern on security
and crime have been deeply rooted in the political history of this country, particularly in recent
time, which has emerged as a key concept in Nigeria„s battle for good governance, sustainable
democracy and development asserted Aremu, PhD.

In this case, the study specifically looks at Uganda, Kampala specifically and we give a brief
over view of the crime statistics in Uganda as compared to other African countries. The rate of
crime in Uganda is very alarming that needs attention urgently. Today every family and business
has been directly or indirectly affected by robberies, burglaries vandalism, sex related crimes and
others. The significant increase in crime deforms the overall development of the nation,
undermines people‟s spiritual and material well-being, and creates an atmosphere of fear,
violence and panic, which compromises human dignity that erodes the quality of life.
Therefore, a sound police-community relation is needed in the battle against crime. Without
adequate involvement by the wider members of the community for instance, police officers are
not likely to receive their endeavors without the involvement of the community.
According to the annual crime report (2017), Homicides, breakings, and others are very rampant
in the high, middle and low density residential areas of Kampala and its surroundings.

2.3 Review of existing system crime reporting systems


Today, a number of researchers and engineers have proposed and developed a number of
systems for crime detection and reporting applied in community policing. This section highlights
some of the most powerful computer based crime fighting systems developed within the past six
years. The overview pays attention to functionalities and principles of operations of these
systems.

8
According to Paul and Luis (2007), the crime stoppers in New Orleans launched a new free
mobile crime-fighting app, for Android and iPhone platforms, called Tip Submit. The application
was developed by Tip Soft and Crime Reports and is known to be the first anonymous tip
submission mobile software. By design, Tip Submit allows users to submit crime tips to Crime
stoppers securely and anonymously. The system identifies users by their tip number only, which
it assigns to the tip. The Mobile App allows users to upload photos or video and is able to send
the location of the video by a GPS locator. Other key feature of Tip Submit is that, it has no
limits on the amount of text as with sending SMS text messages. In addition to that, it maintains
two way dialogue and real-time chat between the tipster and crime stoppers.

Another powerful computer based crime fighting tool is Mobile Vic PD as put forward by
Jennifer (n.d.). Mobile Vic PD is a recently releases mobile application, released by the Victoria
police in Canada for fighting crime. Users can apply the mobile application in reporting minor
crimes, offering anonymous tips to police, staying up to date on crimes progress, instant
notifications on missing child reports or stolen property.
Mobile Vic can be used for the following activities for instance report crime where the suspect is
unknown to you and the total loss is less than $5000 from the convenience of your device, allows
a user to reconnect with their lost or stolen property through photo catalogue, using crime maps
one can see reports of crime in their geographic location, with photos, a person can view and
search for the latest images of VicPD in action in the Flickr archives. On the other hand one can
watch videos from the VicPD You Tube Channel and listen to audio using the VicPD News
features, media releases and interview, traffic complaint and violations are reported online with
actions ranging from general information for the traffic section, warnings, or issuing a ticket.

Accurint was created by LexisNexis for the iPhone and iPad mobile devices. This application
connects government and law enforcement agencies to more than thirty billion public records
and critical investigative tools needed to verify information in the field, and rapidly follow-up on
new leads as they develop. It is a very powerful investigative tool for exaggerating public records
used by thousands of government and law enforcement agencies to enforce laws and regulations,
fight fraud, waste and abuse, not forgetting provision of citizen centric services.

9
Accurint offers a next generation search technology which enables researchers and investigators
to instantly search through billions of public records and perform their jobs more efficiently and
effectively. Accurint offers a number of features among which include advanced Person Search,
People at Work Search, Phones Search, Death Records Search, Business Search, Corporate
Filings Search and Fictitious Business Name.

The United States uses a tactical lead generation tool for law enforcement. Cop Link mobile plus
app was developed by i2. The app is compatible with iPhone, iPad and Android mobile
platforms. The application enables police officers to achieve better situational awareness with
automated geospatial searches of recent events, as it also offers services like searching of state
and local criminal records from multiple jurisdictions‟ databases. Other great feature is its ability
to organize vast quantities of seemingly unrelated data to assist in making tactical, strategic and
command level decisions.

IPOL mobile is an iPhone mobiles software application used for crime fighting by police in
Geneva and Switzerland. It provides the police with immediate access to various information
such as the latest burglary or violence incident as well as the identities of culprits of such crimes.
It avails the police officers with various information such as the latest burglary or violence
incident as well as the identities of culprits of such crimes. It is also able to track the status and
stages of the crime in real time. Officers can track ownership information of vehicles by simply
entering its number plate into the mobile application and can also get important real time
information about their duties for instance patrol hours and location, police directories, lawyers
and translators and their availability hours using the application.

2.4 Weaknesses of the existing system


The current system used has a lot of loophole when coming to the accuracy and keeping
information up to date. The current existing system i.e. manual system refers to the use of book,
pen and ruler‟s in recording information for instance crime reports, business transaction and any
other information.

10
Concerning our project on community policing, UPF have been using the manual system for
quite a period of time and this has created a lot of problems in follow up cases since some crime
cases are not completely resolved with acts as a catalyst to activate other criminal incidences.
However the above system is associated with some weaknesses that should be addressed for
instance; loss of serious crime information by the police as papers where details of the crime are
kept easily gets loss due negligence of duty by the police. The system is expensive due to the
purchase of scholastic material that are need for recording the information of the crime that is
committed.

In conclusion, this chapter covers the literature on issues affecting crime reporting. The global
context on crime statistics, the various approaches done by different countries in resolving high
crime rates using technologies.

11
CHAPTER THREE
METHODOLOGY

3.0 Introduction
This section highlights a detailed description of the road-map for executing the research for
instance the research methods, approach, sample size, sampling technique and requirement
elicitation used by the team to carry out the research.

3.1 Research Design


This research study will adopt mixed method approach incorporating both quantitative and
qualitative techniques in data collection.

According to Kothari (2004), research design is the arrangement of conditions for collection and
analyzing data in such a way that aims to combine relevance to the research objectives. The
approach will allow for adequate investigation and triangulation of data from different sources.
The approach will permit the team to draw on the strengths while minimizing the weaknesses of
each type of data collection technique within the central region of Kampala. Its findings,
conclusion and recommendation can be transmitted even to other Districts.

3.2 Sources of data


The team used both primary and secondary data sources. A primary data source of data could
take form of a document, speech, or other sort of evidence written, created or otherwise produced
during the time under study. For instance self-administered questionnaire, face-to-face interviews
and direct observation while secondary data will mainly be library research and analysis of
related documents like review of printed media on crime situation in Kampala, internet sources
and newspapers. These will be presented in references at the end of the project report.

3.3 Study sample


The sample size is an important supplement of any research in which the main objective is to
make inferences about a population from a sample.

Due to the time and cost feasibility factors, the team shall take a population of 50 comprising of
the community members, councilors, OCS and OCD.

12
The size of the sample should not be too big nor small rather optimum. A good sample must
fulfill the requirements of adequacy, representativeness, independence and homogeneity
(Kothari, 2004). The sample size for the research study will be based on the correctness of the
demanded population size, population heterogeneity and resources available. In order to provide
the needed information on community policing, we shall purposely select 8 members and 92
members shall be randomly selected.

3.4 Systems Development Life cycle approach


During the process of our application design and development, we adopted the Rapid
Application Development. This is because we need to undertake a faster development while
incorporation the necessary requirements of the application by involving the stakeholders of the
proposed system in joint requirement specification and a bit of user training.

3.5 Requirement Elicitation Techniques


Requirement elicitation techniques present the researchers with numerous optional tools that can
be applied to obtain data that fits a given study. Cooper & Schindler (2003) pointed that
gathering of facts and presentation to researchers depends on the data collection methods.

A blend of several data collection methods was used to elicit the necessary data for setting up the
application. This was aimed at triangulating and authenticating the data collected. Therefore, the
team was able to overcome the intrinsic biases that emerge as a result of application of a single
method. The following are key data collection methods that were employed in the research
study;

3.5.1 Questionnaire
According to Kothari (2004), a questionnaire means collection of data using a number of
questions prepared in a paper. This is a data collection technique in which written questions were
presented and answered by respondents in a written form.

Therefore, we drafted written questions which sought to answer and later present to the various
stakeholders of the proposed system which helped in getting detailed and standardized
information about the difficulties they face with the current community policy application as a
way of reporting and management of crime. See Appendix III

13
3.5.2 Observation
In the opinion of the team members, observation was another method considered relevant in
obtaining the necessary information. This is because it was able to give us more accurate
assessment of the actual perceptive of the clients in applying the current system of reporting and
dealing with crime in their community.

At times the other data collection methods for instance questionnaire never captured all the
information like the attitude of the respondents in the field which can only be observed thus
giving us a hint on how to design the system.

3.5.3 Interviews
An interview is the body of techniques used for collection of data (Kothari, 2004). It includes
presentation of oral verbal. The method involves face to face conversation or telephone
conversation. It was used to collect qualitative information that could not be easily obtained
through questionnaire.

We were able to interview some of the stakeholders of the system for instance the staff of UPF
and a few people of the community thereby getting firsthand information about both the existing
system and a hint about the requirement of the system after informing them about the objectives
of the study. All interviews were conducted in private so as to increase confidentially. Some of
the advantages of this data collection method were that there was immediate feedback,
opportunity to reassure the respondent and much more.

3.6 Ethical Considerations


Ethical consideration is basically actions taken to ensure that safety and privacy of the
participants are not violated whatsoever (Resnik, 2005).

These standards include voluntary participation, informed consent, and confidentiality of


information and the anonymity of research participants.

In this regard, respondents were not forced to participate in the study unwillingly, and no
individual‟s right infringed in the process of collecting data. In addition, complete anonymity of
the respondents in the study was ensured.

14
3.7 System Requirements specifications (SRS)
3.7.1 User requirements
The user requirements described what the users will to perform with the application. The
different services, constraints and goals will be established by consulting the stakeholders of the
proposed system.

3.7.2 System requirements


Among the software requirement that were considered during the development are Android
platform basically API 23, the internet, we also embedded Google maps API on the application
to enhance its intended functionalities.

3.7.3 Functional requirements


The core operations of the application will be to report criminal activities.

3.7.4 Non-functional requirements


This will consist of the constraints that must be adhered to during the process of design and
implementation for instance time, cost feasibility and system standards. In other words, the
system is available and accessible, uses less memory, and have security measures like user
authentication.

3.8 System Design Approach


The team undertook Rapid Application Development (RAD) approach with a prototyping
methodology when coming up with the system design. The RAD recommends that analysts and
developers use special techniques and computer tools to speed up the analysis, design and
implementation phases.

This approach enabled us to implement the software solution based on the concepts of
prototyping.

3.9 Systems Testing


We performed a few tests on the developed system upon completion to ensure that the
application was free from bugs and compatible with the user requirements. Basically, a unit test
was carried out to ensure that each UI performs perfectly as intended to. On the other hand, an

15
integration test was also be performed to find out how well the modules or User experience (UX)
operates when linked together as a single unit.

3.10 Systems Implementation


For the application to be implemented or developed into a fully working system, we were able to
use XML for designing the UX and UI, JAVA was introduced in the business logic whereas
Firebase real time database was used in the data tier of our application and Android Studio
technologies as the IDE.

In conclusion, the research was conducted in Nakawa. It adopted a descriptive survey design to
gather the data to accomplish the relevant requirements. The samples were gathered using
snowball method which included; the public and OCS.

16
CHAPTER FOUR
SYSTEM ANALYSIS AND DESIGN

4.0 Introduction
This refers to problem examination and creation of solution. The chapter therefore answers the
objective of designing a community policing mobile application for Uganda Police Force.

In system development, analysis is always carried out to get a better view of what the system will
be able to perform, where it will be applicable, and its general requirements (Denis Alan, 2014).

4.1 Requirement Specification


This refers to a description of a software system to be developed. It is modeled after business
requirements specifications. According to the stakeholders of the application, the following
requirements were collected.

4.1.1 Functional requirements


These are requirements that capture specific behavior of the system being implemented. They
define various things for instance data processing and manipulation, interaction with application
and any other functionality that shows how user requirements are satisfied.

The following are the functional requirements on the reporter’s end.

Functional requirement Description


Login iWatchUG requires users to login before accessing any
system functionality. The application therefore provides
a Graphical User Interface (GUI) with text field for
phone number.

Sign up The application allows a new user to register by entering


their phone numbers and later editing their details so as
to gain access once again in the near future.

Report a crime The system allows a user to report a crime happening

17
around them. They can go ahead to attach evidence in
terms of video or a document. On submitting a report,
their exact location is also retrieved using GPS and
transmitted via that same message.
Delete crime reports At times some reports could be deleted by the user from
their accounts.
Table 1: Functional requirements on the reporter’s end
The following are the functional requirements on the Police officer‟s end.

Functional requirements Description


Login The application ensures that users provide their credentials
before using the system services.
View reported crimes The officers are able to view the reported crime on the
dashboard after logging into the system.
Update crime status It‟s the role of the police officer to update crime status
whether resolved, pending or requiring a court case. So as to
ease the follow up.
Delete reports Updated or resolved crime cases can easily be deleted so as to
management the storage capacity of the application.
Manage user accounts The system gives the officers the authority to delete and
disable user accounts under the authentication option.
Table 2: Functional requirements on the police officer’s end

4.1.2 Non-functional requirements


This will consist of the constraints that must be adhered to during the process of design and
implementation for instance time, cost feasibility and system standards.

18
The table below shows the non-functional requirements of iWatchUG mobile application.

Non-functional requirements Description


Portability The system supports various android platforms
based on the potential market target ranging
from Android API 23

Reliability It is able to perform consistently well basing


on the requirements.

Usability The system is easy to learn and use in order to


achieve quantified objectives with
effectiveness, efficiency and satisfaction.

Scalability It is implemented in such a way that it able to


accommodate any future expansion or upgrade.

Security The application uses real time authentication of


users before gaining access whereby users are
sent s six digit verification code before
accessing the application.

Robustness iWatchUG application is able to cope with


errors during execution and erroneous inputs
e.g. invalid phone number bearing no country
codes.

Availability The system is implemented in real time basis


to ensure that it is running and available most
times in order for users to access information
or resources.
Table 3: Non-functional requirements

19
4.1.3 System Requirements
The system requirements describe the different hardware and software needed for the application
to perform as intended to.

Below are the various systems requirements of the mobile application;

i. Android platform

ii. Firebase real time database

iii. Google Maps

iv. Internet

4.1.4 User requirements


The user requirements are descriptions of what the users will be able to perform with the
application. The application services, constraints and goals were discovered after consulting the
users and later provided as functional and non-functional requirements.

Actors and their characteristics

Crime reporter; The user of this application is able to log in or sign up, view police stations
basing on their real time location.

Police officer; The police officer is able to log in or create an account, view crime reports by
users, receive distress signal.

4.2 System design


This section presents all files, inputs, outputs and programs that were useful in the
implementation of the mobile application.

The actual development was categorized into stages based on the System Development Life
Cycle (SDLC) of software development

20
4.2.1 Structural/ Procedural design
4.2.1.1 Flowchart diagram
It is visual representation of the sequence of steps and decisions needed to perform a process.
The illustration represents the sequence of activities a user undergo when using the application
based on its functionalities.

Start

Login

No

Success? Register

Yes

Report crime View report Delete report Change settings

Stop

Figure 1: Flowchart diagram for the application

21
4.2.2 Object Oriented Design
Use case Diagram
This summarizes in details the system‟s users and their interactions with the system.

iWatchUG Mobile

Login
* *

Create account
*

*
Report crime *
* ***
* *
*
*

Police officer
User View reported crime
*

*
Update crime status

* *

Delete reports

*
Manage user
accounts

Figure 2: iWatchUG use case diagram

22
4.3 System Testing
The team carried various testing to make sure that the system is working as it is intended to.

In the process of checking the quality and all functional aspects of the application, we undertook
the following tests;

Unit testing;
This is a level of software testing where individual units are tested. It usually has one or a few
inputs. Therefore, to ensure effective functionalities of the application, the team tested every
module or UI to be sure that it can be executed following the corresponding rules.

Integration testing
It simply means a level of software testing where individual units are combined and tested as a
group. We combined the various User Interface (UI) to form User experience (UX) then tested in
order to expose faults in the interaction between integrated UX. Among some of the faults we
discovered was inability of the application to authenticate user credentials.

System testing
On the other hand, system testing is one that is conducted on a complete integrated system to
evaluate the system‟s compliance with its specified requirements.
The team later tested the complete working application after getting its installable package on
android API 23.

23
CHAPTER FIVE
SYSTEM DEVELOPMENT

5.0 Introduction
System development is the process of implementing a new software application or program. It
could include the internal development of customized systems, the creation of database systems
or acquisition of a third party developed software. This section answers the main objective of the
study “to develop a mobile-based crime reporting mobile application.” It therefore underscores
the aspect aiming to reduce the time taken to report a crime with in turn helps involve members
of the community and the police in the fight against crime.

5.1 System development


The iWatchUG mobile application can accommodate new user registration and user credential
authentication which are stored on the real time firebase database. When a user successfully logs
into the application, they are able to send an emergency calls, report a case or even search and
view the available police stations from their current location.

The application is only able to execute on android platforms version 6.0 due to the need to target
more awesome features and functionalities provided by higher versions of android.

On the other hand, iWatchUG mobile application has embedded Google APIs for instance,
Google maps and Firebase real time database.

5.2 System implementation


This is the actual development of the application. Thus section therefore provides a detailed
information on the various real world artifacts of the application to the stakeholders.

5.2.1 Login UI
The login User Interface (UI) is implemented to authenticate user credentials in terms of phone
number upon access to the application. Upon correct user authentication, the user would be
granted access to the Home UI else access will be denied.

The screenshot below shows the login User Interface displayed on android phone to allow a user
to login before reporting a crime.

24
Figure 3: Login User Interface

25
5.2.2 Home UI
The Home user interface pops in after successful registration of user details. This UI has a list of
menu report a crime for recording new crimes and My reports for viewing already posted crime
details.

Figure 4: Home User Interface

26
Figure 5: Report crime UI
5.2.3 Report crime UI
The report crime user interface provides the user with the different options when reporting a
crime. They can go ahead to automatically add their current location or input it manually plus
attachments for potential evidence. It was implemented using Google Maps API.

27
5.2.2 Sample implementation code
This section shows some of the source codes used when implementing the application.

5.2.2.1 Login verification code.


This block of codes is for user authentication. It was implemented using Google Firebase
Application Program Interface (API) to enable real time authentication of user telephone number
with a validation code before successfully accessing the system.

28
CHAPTER SIX
CONCLUSION AND RECOMMENDATION

6.0 Introduction
This chapter brings conclusion to the project report which being pointed out in the summary the
result and recommendation from the group, the development of the system and the future work
that will be necessary needed along with the development of mobile application system for
reporting crimes

The chapter highlights the researcher‟s discussions, conclusions, and recommendations which
can be used for future improvements.

6.1 Conclusion
Two assumptions were emphasized on while implementing this study.

The mobile application is based on android phones, i.e. assuming that a majority of crime
reporters are android users. Secondly, the ordinary reporters are able to use their smartphones
and will be able to find iWatchUG application and operate it with ease after awareness
campaigns.

On the other hand, the application is very easy, reliable and safer to embed in making crime
reports. It takes 7 minutes to demonstrate to a new user on a phone which implies that the system
usability was incorporated during the implementation process. It is also important to take note
that many cases reported via hotlines come without evidence which is not the case with
iWatchUG application.

The study therefore made the following conclusions based the objectives;

The current methods used in information collection are manual hence based on human supports
which tend to be affected by human errors and bias which makes it not supportive in faster crime
response and crime solving.

29
Finally, the implemented application would be appropriate and applicable within the public
domain since more than 80 of residents own and use smartphone which are compatible with the
app, crime victims have complains about a number of unsolved crimes which could be sorted by

6.2 Recommendations
The team members researched and found out that the existing method used by police to respond
to the crimes is not effective and has got a gap therefore implementation of a mobile application
would be of help in managing crime rates through an active involvement of the wider community
members.

The iWatchUG mobile application UX was implemented using XML, to enhance the
functionalities. We used Java with Firebase real time authentication in the backend. This is to
enhance user authentication first before viewing the nearby police stations and making crime
reports.

The police officers should take into account data confidentiality for instance user registration
details which should not spill to wrong hands. Disclosing such vital information should be lawful
or by consent of the person.

Some crime reports sent through the application may require urgent response to save lives, or
any other attack. Therefore close monitoring of incoming crime reports is of utmost importance.

The police and other security agencies should be trained with an aim of impacting skills in them
needed to use the application for crime management.

The team members researched and recommended that the application should be tested long side
other existing system that was used before to ensure that it meets the purpose for which it‟s
developed.

Crime reporting awareness is a necessity to every member of the wider community. They need to
be informed about the new and easy way of reporting criminal incidences with an assurance that
whether the crime was detected or not shall not be used against them at all.

30
6.3 Limitations
When the project was being undertaken, the following problems where encountered;.

The project was affected by lack of cooperation amongst the team members it became inevitable
since some of the group members prefer to do their personal work than the project work. The
team had allocated each member a task to accomplish at specific time frame and presenting the
reports about the project.

Insufficient knowledge about programing languages in developing the mobile application many
programing languages are used such as XML and Java. The team therefore conducted a number
of researches about the different programing languages that are needed to develop the application
and use of relevant internet resources during development.

Loss of potential team member due to tuition related issues which threw a big impact on the
team. It was hard to adapt to new plans and strategies has organized before during the first team
meeting earlier in December, 2018.

Failure to complete the project on time. According to our proposed team frame, the
implementation process was to be completed in early April which was not the case. This was due
to lack of corporation among the teamas the result of interest to resolve personal matters.

The project was constrained by difficulty in getting relevant data such as literatureand other
necessary information about developing the mobile-based community policing application.

When incorporating one of the modern techniques of reporting crime on the system i.e. call
centers, it reflects a number of short comings for instance unattended emergency calls which
slows down the response time and gives a possibility of a crime not being resolved.

6.4 Future work


This project research tends to exploit the various loopholes on the community policing and how
it operates with an aim of making the society a safer place. According to the project, a mobile-
based application is implemented to help implement such partnership between the community
and the wider member of the community.

31
However, the project does not look deep into the response time the police takes to act against a
given report which makes it one of the weakness. In other words, a study research should be
conducted to find to how long the police can take to respond to a given crime report.

32
REFERENCES

Annual Crime Report (2017) Retrieved on December 25th, 2018 from


https://www.upf.go.ug/wp-content/uploads/2018/07/ANNUAL-CRIME-
REPORT2017.pdf

Aremu, M., Ph.D. (2006).An Investigation of Security and Crime Management in Developing
Society: The Implications for Nigeria Democratic Set-Up: International Journal of
Academic Research in Business and Social Sciences.

Alexis, A. A. (n.d.). Smuggling and trafficking in human beings: the phenomenon, the markets
that drive it and the organisation that promote it.

Bayley & David, H. (n.d.) Force of order: Police behavior in Japan and the United States
University of California Pres

Bornman, E. (2012). The Mobile Phone in Africa: Has it become a Highway to the Information
Society or not? Contemporary Educational Technology, 3(4)

Blum, R. W., & Ireland, M. (2004). Reducing Risk, Increasing Protective Factors: Findings
From the Caribbean Youth Health Survey. Journal of Adolescent Health (35) pp.
493500.

Celia, V. Sanidad-Leones. (n.d.) The Current Situation Of Crime Associated With Urbanization:
Problems Experienced and Countermeasures Initiated In the Philippines

Central Statistical Office (2006). Population, Social & Vital Statistics. Port of Spain: Ministry of
Planning and Development, Government of the Republic of Trinidad and Tobago.
Retrieved on February 10th, 2019 from
http://cso.gov.tt/statistics/pdf/Table3_19981999.pdf

Chow, SC, Wang H and Shao J. (2007). Sample Size Calculation in Clinical Research, 2nd ed.
New York: Chapman and Hill/CRC.

Crime reports (2004). Introducing Tip submit, Mobile Tips App for IPhone, retrieved on
February 13th, 2019 from https://www.tipsoft.com/TipSubmitMobile.pdf

Disability, poverty and development (2014). Department for International Development.

Ferreira, B. (1996). The Use and Effectiveness of Community Policing in a Democracy. Prod.
National Institute of Justice, Washington, D.C.

Halcon, L., et al (2003). A Portrait of adolescent health in the Caribbean. American Journal of
Public Health 93(11): 1851-7
33
Jennifer Schroeder (n.d.) Database Integration and Access for a Law Enforcement Intranet,
Final Report. Retrieved on February 10th, 2018 from
https://www.ncjrs.gov/pdffiles1/nij/grants/190988.pdf

Kothari, C. R. (2004). Research Methodology: Methods and Techniques. New Delhi: New Age
International Publishers.

James, B. & Gary, M. (2011). Technological Innovations in Crime Prevention and Policing. A
Review of the Research on implementation and Impact: Cashiers Politie studies Jaagang
2011- 3(20) pp. 17-40.

LexisNexis Accurint Mobile. (http://www.lexisnexis.com/government/accurintmobile/)

Muhammad, A., Mohammad R., & Geshina A. (2014). Trend Analysis of Violent Crimes In
Malaysia, Health and the Environment Journal 2(5).

Oliver, W. (1998) Community-Oriented Policing: Systematic Approach to Policing, Prentice-


Hall. Inc, Upper Saddle River, NJ

Heaton. P., & Garicano. L. (2007). Do computers help police fight crime? Center Piece Winter
2007/2008. Retrieved on February 13, 2018 from
https://cep.ise.ac.uk/pubs/download/cp247.pdf

Royal Malaysia Police. (2014). Statistics on violent crimes victim. January to June 2014. Ibu
Pejabat Polis Daerah Seremban, Negeri Sembilan.

Sudhir, A., & Kara, H. (2006). Disability-adjusted life years: A critical review, Journal of
Health Economics.

Transparency International (2006). Global Corruption Barometer 206 Report. Berlin: TI, 2005

United Nations Office on Drugs and Crime (2002). Crime trends in the Caribbean and responses
Reports submitted to UNODC by Harriott A. Vienna: UNODC

IPOL-Mobile application. (http://www.technocrazed.com/ipol-mobile-smartphone-


applicationfor-genevese-police-to-fight-crime)

34
APPENDICES

Appendix I: Sample implementation code

package com.iwatch.mubs.activities;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.multidex.MultiDex;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.iwatch.mubs.R;
import com.iwatch.mubs.utils.Utils;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseException;
import com.google.firebase.FirebaseTooManyRequestsException;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthInvalidCredentialsException;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.auth.PhoneAuthCredential;
import com.google.firebase.auth.PhoneAuthProvider;
import com.google.firebase.firestore.DocumentSnapshot;
import com.google.firebase.firestore.FirebaseFirestore;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

35
import io.github.inflationx.calligraphy3.CalligraphyConfig;
import io.github.inflationx.calligraphy3.CalligraphyInterceptor;
import io.github.inflationx.viewpump.ViewPump;
import io.github.inflationx.viewpump.ViewPumpContextWrapper;

import static com.iwatch.mubs.activities.ProfileSetup.profile_activity;

public class Login extends AppCompatActivity {

private static final String TAG = Login.class.getSimpleName();


private FirebaseAuth mAuth;
private FirebaseFirestore mFirestore;
private PhoneAuthProvider.ForceResendingToken mResendToken;
private PhoneAuthProvider.OnVerificationStateChangedCallbacks mCallbacks;
private String mVerificationId;
private String phonenumber,verificationcode;
private EditText phonenumber_field,verificationcode_field;
private LinearLayout initialView,finalView;
private TextView resend;
private ProgressDialog mDialog;
private boolean secondary;

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(ViewPumpContextWrapper.wrap(base));
}

private void signInWithPhoneAuthCredential(PhoneAuthCredential credential) {


mAuth.signInWithCredential(credential)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
Log.d(TAG, "signInWithCredential:success");
FirebaseUser user = task.getResult().getUser();

mFirestore.collection("Users")
.document(user.getUid())
.get()
.addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
String name=documentSnapshot.getString("name");
SharedPreferences sharedpreferences =
getSharedPreferences(Utils.RADIUS, Context.MODE_PRIVATE);
if(TextUtils.isEmpty(name) &&
36
!TextUtils.isEmpty(sharedpreferences.getString("radius","5000")) ){
startActivity(new Intent(Login.this,
ProfileSetup.class).putExtra("phone", phonenumber));
finish();
}else{

startActivity(new Intent(Login.this, MainActivity.class));


Toast.makeText(Login.this, "Welcome back " + name,
Toast.LENGTH_SHORT).show();
finish();

}
}
})
.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
mDialog.dismiss();
Log.e(TAG,e.getLocalizedMessage());
}
});

} else {
mDialog.dismiss();
Log.w(TAG, "signInWithCredential:failure", task.getException());
if (task.getException() instanceof FirebaseAuthInvalidCredentialsException) {
Snackbar.make(findViewById(R.id.layout), "Invalid code.",
Snackbar.LENGTH_SHORT).show();
}
}
}
});
}

private void initializeActivity() {

ViewPump.init(ViewPump.builder()
.addInterceptor(new CalligraphyInterceptor(
new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/bold.ttf")
.setFontAttrId(R.attr.fontPath)
.build()))
.build());

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

mAuth=FirebaseAuth.getInstance();
mFirestore=FirebaseFirestore.getInstance();

initialView=findViewById(R.id.initialView);
finalView=findViewById(R.id.finalView);

phonenumber_field=findViewById(R.id.phonenumber);
verificationcode_field=findViewById(R.id.verify);
resend=findViewById(R.id.resend);

phonenumber=null;
verificationcode=null;

String phonenumber_reset=getIntent().getStringExtra("phone");
if(!TextUtils.isEmpty(phonenumber_reset)){
secondary=true;
phonenumber_field.setText(phonenumber_reset);
}else{
secondary=false;
}

mDialog=new ProgressDialog(this);
mDialog.setMessage("Please wait...");
mDialog.setIndeterminate(true);
mDialog.setCanceledOnTouchOutside(false);
mDialog.setCancelable(false);

mCallbacks = new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {


@Override
public void onVerificationCompleted(PhoneAuthCredential credential) {
Log.d(TAG, "onVerificationCompleted:" + credential);
signInWithPhoneAuthCredential(credential);
}

@Override
public void onVerificationFailed(FirebaseException e) {
mDialog.dismiss();
Log.w(TAG, "onVerificationFailed", e);
if (e instanceof FirebaseAuthInvalidCredentialsException) {
38
Snackbar.make(findViewById(R.id.layout), "Invalid phone number.",
Snackbar.LENGTH_SHORT).show();
} else if (e instanceof FirebaseTooManyRequestsException) {
Snackbar.make(findViewById(R.id.layout), "SMS Quota exceeded.",
Snackbar.LENGTH_SHORT).show();
}else{
Snackbar.make(findViewById(R.id.layout), e.getLocalizedMessage(),
Snackbar.LENGTH_SHORT).show();
}
}

@Override
public void onCodeAutoRetrievalTimeOut(String s) {
super.onCodeAutoRetrievalTimeOut(s);
mDialog.dismiss();
showFinalView();
}

@Override
public void onCodeSent(String verificationId,
PhoneAuthProvider.ForceResendingToken token) {
Log.d(TAG, "onCodeSent:" + verificationId);
mVerificationId = verificationId;
mResendToken = token;

}
};

private void showFinalView() {

initialView.animate()
.alpha(0.0f)
.setDuration(300)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
initialView.setVisibility(View.GONE);

resend.setVisibility(View.VISIBLE);
resend.setAlpha(0.0f);
finalView.setVisibility(View.VISIBLE);
finalView.setAlpha(0.0f);

resend.animate()
39
.alpha(1.0f)
.setDuration(300)
.start();

finalView.animate()
.alpha(1.0f)
.setDuration(300)
.start();

}
})
.start();

public void onSendFabClicked(View view) {


hideKeyboard(this);
if(validatePhoneNumber()) {
if(secondary){
try {
profile_activity.finish();
}catch (Exception e)
{
e.printStackTrace();
}
}
phonenumber=phonenumber_field.getText().toString();
startPhoneNumberVerification(phonenumber);
}
}

public void onVerifyFabClicked(View view) {


hideKeyboard(this);
verificationcode=verificationcode_field.getText().toString();
verifyPhoneNumberWithCode(mVerificationId,verificationcode);
}

public void onResendClick(View view) {


resendVerificationCode(phonenumber,mResendToken);
}

private void startPhoneNumberVerification(String phoneNumber) {


PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber,
30,
TimeUnit.SECONDS,
this,
40
mCallbacks);
}

private void verifyPhoneNumberWithCode(String verificationId, String code) {


mDialog.show();
PhoneAuthCredential credential = PhoneAuthProvider.getCredential(verificationId, code);
signInWithPhoneAuthCredential(credential);
}

private void resendVerificationCode(String phoneNumber,


PhoneAuthProvider.ForceResendingToken token) {
mDialog.show();
PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber,
30,
TimeUnit.SECONDS,
this,
mCallbacks,
token);
}

private boolean validatePhoneNumber() {


mDialog.show();
String phoneNumber = phonenumber_field.getText().toString();
if (TextUtils.isEmpty(phoneNumber)) {
Snackbar.make(findViewById(R.id.layout), "Invalid phone number.",
Snackbar.LENGTH_SHORT).show();
mDialog.dismiss();
return false;
}
return true;
}

public static void hideKeyboard(Activity activity) {


InputMethodManager imm = (InputMethodManager)
activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
View view = activity.getCurrentFocus();
if (view == null) {
view = new View(activity);
}
if (imm != null) {
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}
}

41
Appendix II: Project Time framework

ITEM ACTIVITY JAN FEB MAR APRIL MAY

1. Proposal writing

2. Data collection

3. Data analysis of
requirements

4. System design

System implementation

5. System testing

6. Project report

Appendix III: Budget

ITEM AMOUNT (UGX)

1. Flash Disk 20,000

2. Stationary 15,000

3. Airtime 20,000

4. Internet 10,000

5. Printing 40,000

6. Transport 25,000

7. Miscellaneous 50,000

Total 180,000

42
Appendix IV: Questionnaire

Dear sir/madam,
We are writing as students of Makerere University Business School, Faculty of Computing and
Informatics. We are conducting a research project on Community policing in other words, how
to bridge the gap between the police and the wider members of the community through the aid of
a mobile application. Its findings will later be submitted to Makerere University Business School
and will go a long way in improving public safety and enhancing development capabilities
among the team members.
The data collected using this questionnaire is intended for academic purposes only and will not
be divulged to any other person. Please take some time and complete the sections provided. All
questions are interrelated and equally important for this study.

1. Gender
Yes A No

2. How long have you stayed in this area?


i. Less than a year
ii. 1 – 2 years
iii. 2 – 3 years
iv. 3 years
v. State
_____________________________________________________________________

3. Have you reported a crime previously to any police station?


Yes A No A

4. Were you assisted in time?


Yes A No A

5. If No, what was the reason for police late assistance?

43
___________________________________________________________________________
___________________________________________________________________________
6. Did the police resolve the matter?
Yes A No A

7. Would you opt to reporting crime from your phone?


Yes A No A

8. If Yes, kindly state a reason for your answer.


___________________________________________________________________________
___________________________________________________________________________

9. Suggest any reporting means that could have made the entire process more effective.
___________________________________________________________________________
___________________________________________________________________________

THANK YOU

44
Appendix V: Interview questions

1. Respondent‟s name?
2. Position in the company?
3. How are criminal activities managed in terms of reports and prevention?
4. How is the current system of crime management?
5. What should be done to improve the current system?

Thank you

45

You might also like