You are on page 1of 50

DEPARTMENT OF SOFTWARE ENGINEERING

ABAARSO TECH UNIVERSITY

Hargeisa Firefighting System


By

1. Muhiyadin Ismail Abdillahi


2. Jimale Abdi Adem
Project Supervisor: Mohamed Daud

A REPORT SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS


FOR THE BACHELOR OF SCIENCE IN SOFTWARE ENGINEERING

Aug,19,2019

i
CERTIFICATE OF ORIGINALITY

I hereby declare that this report, submitted to the Department of Software Engineering of
the Abaarso Tech University as a partial fulfillment of the requirements for the Bachelor
of Science in Software Engineering has not been submitted as an exercise for a degree at
any other university. I also certify that the work described here is entirely my own except
for excerpts and summaries whose sources are appropriately cited in the references.
This report may be made available within the university library for the purposes of
consultation.

20 July 2019

Muhiyadin Ismail Abdillahi (SE-0116/16) Jimale Abdi Adem (SE-0112/16)


________________________ _______________________

ii
Approval Sheet

This is to certify that this project report entitled Hargeisa Firefighters System submitted
by: STUDENT Muhiyadin Ismail Abdillahi (SE-0116/16)
Jimale Abdi Adem (SE-0112/16)

In partial fulfillment of the requirements for the degree of Bachelor of Science in


Software Engineering of the Department of Software Engineering, Abaarso Tech
University during the academic year 2018-19 has been accepted.

Supervisor: ………………………………

Signature: …………………….

Date: …………………………

iii
Dedication

This project is dedicated first to our parents, as well as our long-time study teachers in
all parts of our studying career, friends and all others that are supporting us through that
long term.
It is also dedicated to our teachers, technology, supervisors and the university which gave
us the ability to reach at what we are today.

iv
Abstract

Hargeisa firefighter is a complete and customized solution for Hargeisa firefighter daily
operations. By going through the flow of application one can easily maintain its
operations and emergencies.
This software includes the management of emergency calls, operations, users, staffs,
messages, news and reports.
User-friendly menus can easily generate all the reports in the fastest time.

v
Acknowledgement

In the name to Allah, the most merciful, the most compassionate all praise be to Allah
first and foremost we must acknowledge my limitless thanks to Allah, the Ever-
Magnificent; the Ever-Thankful, for His help and bless. We are very sure that this
work would have never become truth, without His guidance.

We are grateful Mr. Mohamed Daud, Head of the department o f Software


Engineering for his valuable guidance in carrying our work under his effective
supervision, encouragement, enlightenment and cooperation.

We are very grateful to our teachers for the guidance’s, inspirations and constructive
suggestions that are very helpful to reach preparing such huge project.

In addition tribute are made to the entire academic staff in the Department of Software
Engineering and president of Abarso Tech University for the knowledge’s imparted
to us during the years we studing the university All in all we appreciation every person
who will encourage, support and take part to written or develop our project directly or
indirectly.

We also would like to thank to all our beloved friends, who have been so supportive along
the way of doing our research at large for their moral support to the project to ensure
successful completion of our project.

We also thank our families for their generous support they provided us throughout our
entire lives. Because of their unconditional love and prayers, we have the chance to
complete this project

This research method is exprimental

vi
Table of contents

Chapter One Introduction………………...……..………………………………. 1

1.0 Introduction……………………………………………………… ….. 1


1.1 Background…………………………………………………..………. 2
1.2 Problem statement…………………………………………………… 2
1.3 Proposed Solution………………………………………….……….. 2
1.4.1 General Objectives…………………………………...….……….. 3
1.4.2 Specific Objectives…………………………………………… ….. 3
1.5 Scope of the project…………………………………………………. 3
1.6 Procedure & Methodologies………………………………………. 3
1.7 Expectation outcome………………………………………………... 4

Chapter Two: Review of Related Literature…………………………………….5

2.0 Introduction………………………………………….……………….. 5
2.1 General knowledge………………………………….……………… 5
2.2 Comparison of similar systems…………………….…………….... 6
2.3 Current systems……………………………………….……..………. 6
2.4 Solution of Current systems………………………….………………6

Chapter Three Analysis……………………..…………………….……………… 7

3.0 Introduction…………………………………………………………… 7
3.1 Existing System ……………………………………………………….7
3.2 Proposed System ………………………………………………….…. 7
3.3 Requirements specification document…………………………….. 8
3.3.1 Functional requirements …………………………………8
3.3.2 Non-functional requirements……………………………. 9
3.3.3 Hardware requirements…………………………………. 10
3.3.4 Software requirements…………………………………… 10
3.4 Requirement modeling of the proposed system ………………….. 11

vii
3.4.1 Data Flow Diagrams (DFD)……………………………………...11
3.4.1.1 Context Diagram……………………………………….. 11
3.4.1.2 Level 0 Diagram…………………………………………12
3.4.1.3 Level 1 Diagram…………………………………………13
3.4.1.4 Use case diagrams………………………………………14
3.4.1.5 Activity diagrams……………………………………..…15

Chapter Four System Design…………………………………………………….. 16

4.0 Introduction…………………………………………………………… 16
4.1 Architectural Design………………………………………………….16
4.2 User Interface Design………………………………………………..17
4.3 Physical Database Design………………………………...…….... 25
4.3.1 Relational Model (Schema)………………………………………. 26
4.3.2 Data Dictionary…………………………………………………… 27

Chapter Five Implementation and Testing……………………….……………..29


5.0 Introduction………………………………………………………….. 29
5.1 Development Tools ………………………………………...………. 29
5.2 Sample Codes………………………………………………………... 30
5.2 Difficulties …………………………………………………………… 37
5.3 Testing ……………………………………………………..………… 38
5.3.1 Unit Testing………………………………………………..………. 38
5.3.2 Integrating Testing………………………………………………... 39
5.3.3 System Testing…………………………………………...………... 39

Chapter Six Summary and Conclussion………………………………….……. 40

6.0 Introduction……………………………………………………………40
6.1 Conclusion and summary…………………………………………… 40
6.2 Reference………………………………………………………………41

viii
List of figures

Context diagram ……………………………………………………………………..…..11

Level 0 diagram ……………………………………………………………………...…..12

Level 1 diagram ……………………………………………………………………….…13

Use case diagrams ………………………………………………………….………..…..14

Activity diagram ……………………………………………………………….…...……15

Architectural design ……………………………………………………….………...…..16

Interface design …………………………………………………...……………..… 17 - 24

ix
Chapter One
INTRODUCTION
1.0 Introduction

Fire is a natural disaster which can affect everything and happen at any place in any time,
Hargeisa was developing in the last 20 years
So according to the people, economy and risk of fire to the city and its development local
government of Hargeisa was made Champers of firefighting in mid of 2014 which is later
become Somaliland firefighters.
Today firefighters exist all over the region of Somaliland by doing their daily duties and
surviving many human life’s and their properties. Hargeisa firefighter’s department works
the all districts in Hargeisa.
The fire departments have special commander and director, who well manages the work
and performances. They use modern trucks with skilled drivers as well as qualified well-
trained employees, who always tries to face danger of their lives to save the people’s
lives.
Controlled fires enhance our quality of life but unwanted fires can cause loss of life and
property. Over the last years, there has been dramatic increase in the number of
publications on firefighters’ legislations and firefighter’s management.
Since the established Hargeisa firefighters, the ability and power of the fire bridges were
increasing day after day to help the community and support and fire incidents.
Hargeisa firefighters’ departments now have more than 30 modern trucks which
immediately works in the capital city.

1
1.1 Background
Firefighters: - are people their job is to put out fires and save people in the fire. In a city, the
building, they work in a place a called fire station, or fire hall. Firefighters work for the fire
department.
They fight fire in cities and towns also fight fires in houses and other buildings.
A firefighter suppresses and extinguishes fires to prevent loss of life, or damage of property and
the environment. Firefighters also provide many other important services to the society they
serve, like health or emergency medical services.
Firefighting requires professionals of high technical skills, who have finished many years for
training in both general firefighting techniques and particular areas of capability.
Some of the specialized area of fire and rescue operations include local government and airport
rescue and so referred this document as Hargeisa firefighter’s management system (HFFS).
Firefighters' their objective is to save lives, property and the environment. A fire can quickly
spread and endanger many lives, however, with modern firefighting techniques, can prevent fires
from starting, and can be survive people’s lives and property.
We have chosen to help activities of firefighter in Hargeisa by mapping operations to the
locations of emergency, improving inter connectedness of different branches, producing reliable
reports and improving management

1.2 Problem statement

The problem of the operational system is using in manual system, when someone calls the
emergency number of firefighters and tell them ‘There is a fire in my house’ they can’t know your
location, to get your location they ask you questions and there is an interview until they get your
house,
Also, there is no official report they use manual system to record the report of the operations

1.3 Proposed Solution

Our proposed system solves all the problems stated above, The System is an automated connected
people to the firefighter’s station.

2
This system provides the location of the emergency calls and they get the location of the fire easily
and there is a line drawing the distance between the fire and the firefighters station even it shows
the nearest way to reach the location of the fire.
Also, the system collecting all information’s such as what caused the fire, Location of the fire,
Number of dies, the time taken to reach the fire and all other important information after that the
system generates meaning full report per operation or monthly.

1.4.1 General objectives of firefighting emergency calls in Hargeisa, Somaliland

The specific objectives of this software are to store, save all information related to fire incidents
and firefighters’ departments.
Also get back that information, manipulate the information, create reports and take decision
based on the reports generated. of this software is to store, save all information related to fire
incidents and firefighters’ departments. Also get back that information, manipulate the
information, create reports and take decision based on the reports generated.

1.4.2 Specific Objectives

• To reduce the time taken to search the location of the fire


• To get the exact location of the fire
• To produce reliable report to help government make policy of preventing fire

1.5 Scope of the project

Our proposed system will be done in 4 Months, the system is based only Hargeisa not for other
cities.

1.6 Procedure & Methodologies

1. MySQL, selected for Database development and processing DBMS.


2. Android Studio for the android app.
3. Visual Studio Code using as editor and developing Web Application.
4. Kotlin for Android app
5. PHP for Web application
6. Software Development methodology is purely Web Application and Mobile App

3
7. The methodology using our proposal project is agile development model is also a type of
Incremental model. Software is developed in incremental, rapid cycles. This results in
small incremental releases with each release building on previous.

1.7 Expectation outcome

We are expecting our system to do the all tasks of the Hargeisa firefighters such as, getting the
exact location of the fire, monthly and yearly report of the fires, also we expect to be effective,
efficiency, high performance and security.

4
Chapter Two
Review of Related Literature
2. Introduction

The computerized Firefighter and Emergency Management systems provide many benefits that
are hard to obtain using paper, files and other small applications.
The computerized system support emergency locating, report generation and enhance
collaboration of the agency. To improve efficiency, minimize risk, and help managers make key
decisions also improves data collaboration, reliability and security by using a centralized
database with higher security checks.
The main advantage of the system is to reach risk at the lowest time through the shortest path by
online geolocating the risk path then choosing the best option to get there as much as faster they
can.

2.1 General knowledge

Firefighting is the act of attempting to prevent the spread of and extinguish significant unwanted
fires in buildings, vehicles, woodlands, etc. A firefighter suppresses fires to protect lives,
property and the environment: (Wikipedia definition)
“Firefighting is an extremely important job. Firefighters save people risking their own
lives. Whenever anyone sees a fire, they call the firefighters. Immediately, the fire brigade race
to that place with a gigantic red machine truck. During a fire, there could be confusion, so the
fire fighters are organized and put to different duties. There are hose handlers, ladder handlers,
truck driver, inspectors and the rescuers. Since there is a great amount of heat put off from fire,
fire
fighters wear protective clothing. These fire fighters are supervised by fire captains, battalion
chiefs or the fire chief. There are also some fire marshals, who try to figure out what started the
fire.” said (fb: @Edu.bd.restart 2016)
“Firefighting is an emergency allocation of resources, required to deal with an unforeseen
problem. In software development, for example, firefighting might involve assigning extra
programmers to fix coding bugs that are discovered close to a product's release date; in a security
context, it might involve allocating resources to deal with the breach of an information system or
the outbreak of a computer virus. At the individual user level, firefighting might involve dealing

5
with hardware or software problems that could have been prevented with basic computer
maintenance practices.” (whatsis techtarget definition)

2.2 Comparison of similar systems

The two theories the computerized systems are better than the manual systems. The
computerized systems also increasing the customer satisfactions and reducing delay time. In
addition, our project proposal has a lot of benefits include:
Easy to locate the emergency location,

Efficient staff management,

Can generate required reports easily,

Easy to manage historical data in a secure manner,

database helps in avoiding conflicts and

Easy to use a GUI that does not requires specific training

2.3 Current systems

The current system is a manual system that’s is based on calling emergency number then taking
required information through that call without knowing actual data specially location which is
the most important thing in emergencies.
Current system also does not have sufficient reports because less data savings.

2.4 Solution of Current systems

The proposal system is an automated interconnected all levels of agency such as senior
Managers, staffs and customers. This system provides every member a specific role and specific
tasks. The senior managers Is easily to know the process of work using inside the system and
system permit senior managers to checks and retrieve data outside of the agency because the
system is an online and responsive. The System will create and controls the flow of data,
provides data security, and manages network operations.

6
Chapter Three
ANALYSIS
3.0 introduction

This chapter is the most important chapter in the thesis. Just we can say “The hard part of the
project” so this chapter gets a great role by its significant parts that it consists.
It contains proposed system and also requirement specification document which is the functional
and non-functional requirements of the project.
This chapter also contains functional modeling which is the diagrams such as context diagram,
dataflow diagram and many others.
So, this is the most important chapter that determines the view of the whole project.
We hope to everyone who read this chapter will exactly understand the whole prototype of our
project.

3.1 Existing System

Firefighting department works for many emergency aspects include fire and crashes.
The most important thing of existing system is answering emergency calls and operating using that
calls.
Someone calls the fire-emergency number then staffs of calling center answers the call they ask
some important questions include location and type of emergency then calling center approves the
emergency and if its applicable they pass to the operations department by calling them and telling
information then operators go to that location then it works until they finish when operation
finishes they report it manually.
Existing system does not have efficient report generation and it have a serios risk for the documents
to lost.
Also, all the departments of the organization have only oral communication or manual and often
it causes some misunderstandings and other things that can be very vital to the emergency.

3.2 Proposed System

The proposal system is an automated interconnected all levels of organization such as managers,
staffs and customers. This system provides every member a specific role and specific tasks. The

7
managers can easily follow the process of work when he is inside or outside of his office because
the system is an online and responsive. The System will create and controls the flow of data,
provides data security, and manages network operations and will create online locating so
customers can be known where is there are now and to be operated at the least time in that place.
The system reduces customer and organization misunderstandings for locating and delays.
Also, system will generate useful reports and will make very transparent to the organization.

3.3 Requirements Specification Document

The requirement specification document is produced at the end of Analysis of the system. This
document is a very comprehensive document and contains all the User requirements, Customer
requirement, and also Analysis diagrams. The Requirements are broadly divided into four groups:
1. Functional requirements
2. Non-functional requirements
3. Hardware requirements
4. Software requirements

3.3.1 Functional Requirements

Requirements Specification is a comprehensive document and contains a lot of data, it has been
broken down into different parts in this report. The functional requirements in the system are
include:
An emergency calls registration,
An emergency calls approval,
An operation starts,
A live map operation work,
A finishing and registering operation report,
A generating report,
A sending message to users and
A sending news to users

8
Staff requirement

Login

Approve emergency calls

Starting operations

Live map operation working

Reporting operations

Viewing and managing reports

CRUD for staff logins

News

User management

Messages management

Customer requirement

Calling emergency number and telling exact location fire to the organization

3.3.2 Non-functional requirements

The non-functional requirements of the Hargeisa Firefighting systems areas described below.

Security

1. The system must have protection from unauthorized users. By using username and
password.
2. Also, system show error if the username or password is not correct
3. To use the system, every staff has to login by key in their username and password.
4. Only manager can change and create staffs’ logins in order to increase security.

Performance

1. The system is supposed to respond in less than 5seconds.


2. The system should display a user-friendly menu for users to choose from.

9
Availability

• Services of the system required be available 24 hours a day


Android 4.0 and above can use the system
The system is available over the internet for management so
that they can use their respective locations which could be
anywhere in the organization and in the world

Maintenance: The store Management System is being developed in PHP. Php is an object-
oriented programming language and shall be easy to maintain
Portability: -The store Management System shall run in any Microsoft Windows environment
that contains PHP Runtime.
Reliability: - The store Management System service should not access without authenticate user.
Standards Compliance: - The graphical user interface of the system shall have easily
understood to the user (have consistent look and feel graphical user interface).

3.3.3 Hardware requirements

Hardware Minimum System requirement


Processor 2.5 GHZ processor speed or higher
Memory 256 MB RAM
Disk space 32 GB or more
Display 800 x 600 colors (1024 x 768 High color-
16 bits Recommended)

3.3.4 Software requirements

Software Minimum System requirement


Operating System Any operation system with internet
capability
Database MYSQL, Firebase

10
Programming languages Kotlin, PHP
Compiler JVM, All php runtimes
Web browser All browsers (except TOR and its family)

3.4 Requirement (Functional) modeling of the proposed system

Functional models are used to document and understand requirements. Describe business processes
and interaction with environment. Used for both as-is and proposed systems.
The specific models created depend on the technique being used for systems analysis. The modern
structured analysis technique uses data flow diagrams (DFDs) and entity- relationship diagrams
(ERDs). Object-oriented techniques produce class diagrams and use case diagrams.

3.4.1 Data Flow Diagrams (DFD)

The traditional approach to information system development describes activities as processes carried
out by people or computers. A graphical model that has proven to be quite valuable for modeling
processes is the data flow diagram.

3.4.1.1 Context Diagram

11
3.4.1.2 Level 0 Diagram

12
3.4.1.3 Level 1 Diagram

13
3.4.1.4 Use case diagrams

14
3.4.1.5 Activity diagrams

Staff registrations activity diagram

Operation reports activity diagram

15
Chapter Four
SYTEM DESIGN
4.0 Introduction

This chapter generally describes Database design model, Architectural design and Interface
of the Hargeisa Firefighters System. The database model is based on the entity-relationship
model, data dictionary, ER diagrams, conceptual data model and it can be implemented by
relational database management systems. Also database design help to eliminating
redundant and duplicate data if there exists any. The interface components are support how
to make data entry, data display also manage data in different forms at same time.

4.1 Architectural Design

The client users are calling the Emergency Number through the Mobile App then sends
their location via Web server to Database server.
The Database Server receives the client requests from Web server and return relevant
results via Web server to call center, after that the Call center gets the exact location of
the client
Although the clients receive news and messages from Web server

16
4.2 User Interface Design
A user interface is the part of the system with which the users interact. It includes the screen
displays that provide navigation through the system, the screens and forms that capture data, and
the reports that the system produces.

Login

Register New Staff

17
Staffs

This page is containing all registered staffs, also can modify or delete them.

18
Home

Messages table

19
Message details

News

20
Users

Operation’s report

21
News preparation

Printing view in reports

22
Operations report detail

Summary report charts

23
Map views for reports

Operations and emergency maps

24
4.3 Physical Database Design

In this phase the internal storage structures, file organizations, indexes, access paths, and
physical design parameters for the database files are specified. In parallel with these
activities, application programs are designed and implemented as database transactions
corresponding to the high level transaction specifications.

CREATE TABLE `STAFFS` (

`ID` int(11) NOT NULL AUTO_INCREMENT,

`FULL_NAME` varchar(500) NOT NULL,

`USERNAME` varchar(100) NOT NULL,

`PASSWORD` varchar(500) NOT NULL,

`POSITION` varchar(100) NOT NULL,

`MOBILE` bigint(30) NOT NULL,

`PHOTO` varchar(200) NOT NULL,

`REG_DATE` datetime NOT NULL,

PRIMARY KEY (`id`) )

CREATE TABLE `EMERGENCY` (

`ID` int(11) NOT NULL AUTO_INCREMENT,

`LATITUDE` double NOT NULL,

`LONGITUDE` double NOT NULL,

`PHONE` bigint(20) NOT NULL,

`DATE` datetime NOT NULL,

PRIMARY KEY (`ID`)


)

CREATE TABLE `FINISHEDOPERATIONS` (

`ID` int(11) NOT NULL,

`OPERATOR` varchar(100) NOT NULL,

`LATITUDE` double NOT NULL,

25
`LONGITUDE` double NOT NULL,

`PHONE` bigint(20) NOT NULL,

`REQUEST_DATE` datetime NOT NULL,

`STARTING_DATE` datetime NOT NULL,

`FINISHED_DATE` datetime NOT NULL


)

CREATE TABLE `NEWS` (

`ID` int(11) NOT NULL AUTO_INCREMENT,

`TITLE` varchar(500) NOT NULL,

`BODY` longtext NOT NULL,

`NEWS_IMAGE` varchar(500) NOT NULL,


`NEWS_DATE` datetime NOT NULL,
PRIMARY KEY (`id`)

4.3.1 Relational model (schema)

A. Staff Table ( id: Number, full_name: String, username: String, password: String,
position: String , mobile: Number, photo: String, reg_date: datetime)

B. Emergency Table ( Id: Number, operator: String, latitude: String, longitude: String,
phone: Number, date: date)

C. Finished_operations Table ( id: Number, operator: String, latitude: String, longitude:


phone: Number, request_date: date, starting_date: date, finished_date: date)

D. News Table (id: Number, title: Sting, body: String, news_image: String, news_date:
date )

26
4.3.2 Data dictionary

Emergency Table

Fields Name Null Key Description

id No Primary key The id of the emergency call

latitude No Latitude of the emergency call

longitude No Longitude of the emergency call

phone No The emergency phone number

date No The date of the getting


emergency call

Finished operations Table

Fields Name Null Key Description


id No Primary key The id of the operation
operator No
latitude No Latitude of the emergency call
longitude No Longitude of the emergency call

phone No The emergency phone number

27
request_date No The date you get the emergency
call

starting_date No The date you begin the


operation

finished_date No The date of the finishing


operation

News Table

Fields Name Null Key Description

id No Primary key The id of the news

title No The title of the news

body No The body of the news or news


details

news_image No The news image

news_date No The date of the news

28
Chapter Five

IMPLEMENTATION AND TESTING

5.0 Introduction

This chapter contains the Development tools, Sample codes and difficult face. We explain
in this chapter tools we are using to develop this project

5.1 Development Tools

No Tool Usage

1. Visual studio code Using as editor to write codes

2. Android studio Using to develop the Android App

3. MySQL The whole database of the project

4. PHP Using to develop the back end of the project

5. Kotlin Using to develop the Android App

6. Firebase Using the analytics of the android App

7. Apache The server of the project

8. Microsoft office 2016 Using to prepare the documentation and presentation

29
5.2 Sample Codes

This is some sample codes of the project,


This below code is responsible for making calls and sends the users location to the web
server

package com.jca.dabdemiskajsl.activity

class MainActivity : AppCompatActivity() {

private val prefname = "registershared"


private var REQUEST_CHECK_SETTINGS = 0x1
private var mFusedLocationProviderClient: FusedLocationProviderClient? = null
private val INTERVAL: Long = 2000
private val FASTEST_INTERVAL: Long = 1000
lateinit var mLastLocation: Location
private lateinit var mLocationRequest: LocationRequest

override fun onCreate(savedInstanceState: Bundle?) {


super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

mLocationRequest = LocationRequest()

RequestGPS().gps(this)
startLocationUpdates()

title="JSL Dabdemis"

//adding my actionbar

30
setSupportActionBar(mytoolbar)
addingviewpagers()

//startLocationUpdates()
calling()
stopgps()
Handler().postDelayed({

// Check().disableapp(this)

},3000)
}
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
Log.d("onActivityResult()", resultCode.toString())

//final LocationSettingsStates states = LocationSettingsStates.fromIntent(data);


when (requestCode) {
REQUEST_CHECK_SETTINGS -> when (resultCode) {
Activity.RESULT_OK -> {

}
Activity.RESULT_CANCELED -> {
finishAffinity()
}
else -> {
}
}

}
}

31
private fun addingviewpagers(){
val adapter = ViewPagerAdapter(supportFragmentManager)
adapter.addFragment(NewsFragment(), "Wararka")
adapter.addFragment(InboxFragment(), "Fariimaha")
adapter.addFragment(ProfileFragment(), "Xogta")
viewPager.adapter = adapter
tabs.setupWithViewPager(viewPager)
}

private fun calling(){


btncall.setOnClickListener {

AlertDialog.Builder(this)
.setCancelable(false)
.setTitle("Fiiro gaar ah")
.setMessage("Fadlan ma hubtaa inaad joogto goobta dhibaatadu ka dhacdey")
.setPositiveButton("Waan joogaa") { _, _ ->

val locationManager = getSystemService(LOCATION_SERVICE) as


LocationManager
if
(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {

RequestGPS().gps(this)

}
else{

makeCall("993")
Check().updates(this)

32
Handler().postDelayed({
toast("45 secs end")
senddata()
},45000)

}
.setNegativeButton("Ma joogo"){_, _ ->

Check().disableapp(this)
}
.show()
}
}

override fun onCreateOptionsMenu(menu: Menu?): Boolean {


menuInflater.inflate(R.menu.top_menu,menu)
return true
}

override fun onOptionsItemSelected(item: MenuItem?): Boolean {

when(item!!.itemId){
R.id.contactus ->
toast("Nala soo xidhiidh")
R.id.about ->
toast("Nagu saabsan ")
}

33
return super.onOptionsItemSelected(item)
}

//The location methods


private fun startLocationUpdates() {

// Create the location request to start receiving updates

mLocationRequest.priority = LocationRequest.PRIORITY_HIGH_ACCURACY
mLocationRequest.interval = INTERVAL
mLocationRequest.fastestInterval = FASTEST_INTERVAL

// Create LocationSettingsRequest object using location request


val builder = LocationSettingsRequest.Builder()
builder.addLocationRequest(mLocationRequest)
val locationSettingsRequest = builder.build()

val settingsClient = LocationServices.getSettingsClient(this)


settingsClient.checkLocationSettings(locationSettingsRequest)

mFusedLocationProviderClient =
LocationServices.getFusedLocationProviderClient(this)
// new Google API SDK v11 uses getFusedLocationProviderClient(this)
if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_COARSE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {

34
return
}
mFusedLocationProviderClient!!.requestLocationUpdates(mLocationRequest,
mLocationCallback,
Looper.myLooper())
}

private val mLocationCallback = object : LocationCallback() {


override fun onLocationResult(locationResult: LocationResult) {
// do work here
locationResult.lastLocation
onLocationChanged(locationResult.lastLocation)
}
}

fun onLocationChanged(location: Location) {


// New location has now been determined

mLastLocation = location
// val date: Date = Calendar.getInstance().time
// val sdf = SimpleDateFormat("hh:mm:ss a")

//
// txttime.text = "Updated at : " + sdf.format(date)
//txtlongi.text = mLastLocation.latitude.toString()+","+
mLastLocation.longitude.toString()

txtlati.text = mLastLocation.latitude.toString()
txtlongi.text = mLastLocation.longitude.toString()

35
val bb = mLastLocation.latitude.toString()+","+ mLastLocation.longitude.toString()
Log.d(bb,"messageloc")

private fun stopLocationUpdates() {


mFusedLocationProviderClient?.removeLocationUpdates(mLocationCallback)
}

private fun senddata(){

//Retrieve phone number from sharedprefrence


val shared = getSharedPreferences(prefname,MODE_PRIVATE)
val phone = shared.getString("phone","")

//sending data into call centers


AndroidNetworking.post(API.sendopera)
.addBodyParameter("phone",phone)
.addBodyParameter("latitude",txtlati.text.toString())
.addBodyParameter("longitude",txtlongi.text.toString())

.setPriority(Priority.MEDIUM)
.build()
.getAsJSONObject(object : JSONObjectRequestListener {

override fun onResponse(response: JSONObject?) {

Toast.makeText(applicationContext,response?.getString("message"),Toast.LENGTH_SH
ORT).show()

36
}

override fun onError(anError: ANError?) {


Log.d("ONERROR",anError?.errorDetail?.toString())
Toast.makeText(applicationContext,anError?.errorDetail?.toString(),
Toast.LENGTH_SHORT).show()
}

})
}

//Method for stop location updates


private fun stopgps(){

Handler().postDelayed({
stopLocationUpdates()
toast("stop gps")
},60000)
}
}

5.2 Difficulties

There are no more difficulties facing for us when we are developing this system, but there
is only one problem,

That problem is our system is not working without internet connection we need connection
to know where emergency calls are coming, without connection we can’t track the users
who want to get help,

37
In our community it’s hard to get internet connection for emergency situations, the people
want only to call the emergency number without internet connection and that’s a pig
problem

In this project still, we force the people to call the emergency number through our Mobile
app although our App can’t work without internet.

5.3 Testing

Testing is a process, which reveals errors in the program. It is the major quality measure
employed during software development. During software development. During testing,
the program executed with a set of test cases and the output of the program for the test
cases evaluated to determine if the program is performing as it expected to perform.
In order to make sure that the system does not have errors, the different levels of testing
strategies that applied at differing phases of software development are:

5.3.1 Unit Testing:

Unit testing done on individual modules as they are completed and become executable. It
confined only to the designer's requirements. Each module can be teste using the following
two Strategies:

1. Black Box Testing:

• In this strategy, some test cases generated as input conditions that fully execute all
functional requirements for the program. This testing has been uses to find errors
in the following categories:
• Incorrect or missing functions
• Interface errors have been executed.
• Errors in data structure or external database access
• Performance errors
• Initialization and termination errors.

38
2. White Box Testing:

In this, the test cases generated on the logic of each module by drawing flow graphs of
that module and logical decisions tested on all the cases. It has been uses to generate the
test cases in the following cases:

• Guarantee that all independent paths Execute all logical decisions on their true and false
Sides
• Execute all loops at their boundaries and within their operational bounds.
• Execute internal data structures to ensure their validity.

5.3.2 Integrating Testing:

Integration testing ensures that software and subsystems work together a whole. It tests
the interface of all the modules to make sure that the modules behave properly when
integrated together.

5.3.3 System Testing:

Involves in-house testing of the entire system before delivery to the user. Its aim is to
satisfy the user the system meets all requirements of the client's specifications.

39
Chapter Six

SUMMARY AND CONCLUSSION

6. Introduction

In this chapter we will give a brief summary about the dissertation, and highlight the importance of
the project as well as what have been achieved
We will also include a discussion of crucial points related to the solved problems in the project and
present future work and ideas to improve the system that has been developed.

6.1 Conclusion and summary

The benefits of hargeisa firefighting system is locating emergency place to operate the lowest time
possible and improve the overall system efficiency, reliability, security, maintenance, portability and
availability.
In this project we develop interconnected mobile and web applications that contains more than 5 main
parts include

• Staff management
• Emergency management
• Operation management
• Messaging to users
• Users management
• News management

There are several things that’s needed for overall firefighters in our country to improve their work

First training staffs to the system to adopt it and use it as the best.

Second budgeting the system in order to buy its vital component such as internet modem, mobile or desktop
device and others include furniture’s

Finally, to make this project successful we must work all aspects that firefighting consider.

40
6.2 Reference

1. https://en.wikipedia.org/wiki/Firefighting

2.https://www.facebook.com/Edu.bd.restart/posts/11-a-firefightera-
firefighterintroductionfirefighters-are-persons-who-are-traine/621569938027375/

3. https://whatis.techtarget.com/definition/firefighting

4. Connolly, T. (2004). Database Systems: A Practical Approach to Design,


Implementation and Management (4th Edition). 4 Editions. Addison Wesley

5. Weldon, J. (1981), Database Administration, New York and London: Plenum Press

6. Norman, M. (2003). Database Design Manual: using SQL for Windows (Springer
Professional Computing). 4th Edition. London: Springer-Verlag.

7. Elmasri, R. and Navathe, S. (2011), Fundamentals of Database System. 6th Edition,


USA: Pearson Education Limited

8. Database Analysis. 2013. Database Analysis. [ONLINE] Available


at:http://db.grussell.org/section004.html. [Accessed 17 October 2013].

9. Course: Systems Engineering. 2013. Course: Systems Engineering. [ONLINE] Available


at: http://ocw.metu.edu.tr/course/view.php?id=22.. [Accessed 7 October 2013].

10. Database System Concepts. 2013. Database System Concepts. [ONLINE] Available
at: http://cnx.org/content/m28150/latest/.. [Accessed 17 November 2013]

41

You might also like