SOS Application Under Android: Help Pro

Information and Communication Technologies are regularly used in medical services and associations around the world. An increasing number of devices running Android as Smartphones, smart TV and tablets, are comprehensively utilized for numerous purposes. For these devices, there are distinctive types of health and medical applications that provide an easy access to patients and their caretakers to save time [1]. In this work, we develop an Android application named Help Pro with an important goal: save lives by a single tap. In case of emergency, Help Pro users could have an ambulance available within 100 m of the user’s real-time location. Through the Dijkstra algorithm, this application employs Google Maps API (Application Programming Interface) to trace the nearest way in order to an available ambulance arrives on time. Consequently, not only time is efficiently saved but also precious lives.


Introduction
An emergency is a great issue in Pakistan [1]. In every 4 min, one life is lost to an accident and in every 1 min, one life is lost to cardiac attack and other emergencies. Insights of the last decade show that every day in Pakistan 15 people lost their lives because of car accidents [2]. The foremost likely cause behind a person's demise in a mishap is an absence of the first aid arrangement that is a result of emergency services aren't getting convenient data about accidents. Emergency response time is amazingly crucial when it includes incidents and vehicle mishaps. Examination creates the impression that if we decline only 1 min in mishap reaction time that can expand chances of sparing a person's life till six percent [3].
An emergency-based adaptable application can assist people in unforeseen circumstances. The application's real-time responsiveness will dynamically help users. For every feature implemented, both service & help content are just one click away. Additionally, the application should be able to overcome an important problem in Pakistan: give directions to reach a place. This becomes incredibly tough when you are on a highway, road or in a new area.
To reduce time spent on giving directions and make you focus on more important things, we are proposing an application that also involves engagement of the user with other emergency services such as calling for firefighters & police, mechanic options, blood requests, and requests to the nearest ambulance as well. The Help Pro application is partitioned into three modules: admin app, driver app, and user app. GPS is employed to track the location of both user and driver so that both entities will be able to track each other's location I n their app. Help Pro allows the user to register, edit profile & ICE (In Case of Emergency) numbers, and contains pre-defined SOS (Save Our Souls) numbers as well. On the other hand, it enables users to send and get Blood Donation requests from registered users which is all just one tap away.

Research Objective
This research is done to design and implement such an application system that uses all smartphones to help people and to provide ease to them in a critical situation. The live feed data of the user is sent through the app to the driver, which helps in keeping track of the user's location. The communication is kept secure between the driver app and user app so that only authorized personnel is allowed to do the same. Another objective is to make a simple and user-friendly operation using Help Pro, with extensions to make calls to other non-medical services but equally useful, like firefighters or police.

Scope
This mobile application targets users that are using a smartphone. This project is developed to make emergency resources available in the least time possible. It is especially useful for those users involved in an emergency. It consists of three different modules: User, Driver, and Admin applications. Additionally, has the benefit of being free of cost.

Background
Help Pro is an emergency-based application created with real-time location-based services using Firebase, maps and navigation through Google APIs, providing an interface to request service as per your need. The vital role of this application is to utilize each millisecond effectively to spare individuals. Nowadays, many lives are being lost due to the patients are not able to reach the hospital on time and each second delay might cost them their lives. In this venture, we have structured a model which would help all the affected people systematically and time real.

Technical Structure
In this section, the different technologies employed in the system are listed and explained.

Android
Android is an open-source smartphone OS dependent on the Linux kernel that Google produces for tablets, mobile smartwatches, TVs, vehicles, and many other electronic devices.
As it is open source, everybody has complete access to the source code for Android, but there is a limitation: it can't be utilized for individual increase or any budgetary advantage [4].

Android Studio
Android IDE (Integrated Development Environment) is a key of Android Studio. It offers all the tools needed by an android developer to create an android application. More importantly, it allows auto-completion software to write a program, debug, check, and execute the code on a real or virtual device [5].

Java
Java is an OOP (Object Oriented Programming) language, which is a class-based general-purpose language. Java is used as a backend programming language for android development.

Firebase
Firebase is a forum for web applications. It lets developers develop high-standard applications. It stores information in the configuration of JSON (JavaScript Object Notation) that doesn't utilize query to insert, update, and remove data. It is an online database framework to store data [6]. Firebase also contains services like authentication, real-time database, image storage, cloud messaging, and more.

Google Map API
Google APIs are a series of application programming interfaces (APIs) developed by Google that allows interaction and adoption of google services into other services. These APIs include services like maps, routes, real-time location, and places.

Laravel
Laravel is a framework of PHP software platform, which is free and open source developed by Taylor Otwell and intended to build web apps based on the architectural template known as model, view, and controller and built upon Symfony, which is a PHP framework.

Proposed System
Our application Help Pro is developed in Java as a backend programming language by using Android Studio as IDE. It has been developed for an Android operating system having a minimum API level 17, and target API level 26. The application is completely working and implemented on the android smartphone. The designed system consists of three modules: User, Driver and Admin.

User Module
End-user applications consist of four major functions: (i) One-click emergency services, (ii) Nearby hospitals, (iii) Blood request option, and (iv) Mechanic option.
Whenever a user will sign up, he will be asked to enter his contact number which will be confirmed through the One Time Process. Then a code will be sent to the contact number by Firebase Phone Authentication, as shown in Fig. 1.
Once the contact number is registered, the user is required to enter their personal details such as name, date of birth, blood group, city, gender, and picture (Fig. 2). After it, the user is asked to enter two ICE numbers only then the application is ready to use.
User Interface is designed in a manner that it can be adapted very easily by the user. The main interface has a button through which an ambulance can be called, after tapping the button it will prompt you to ask whether if it's for self-use or someone else. In case of selfuse after 5 s, confirmation timer's automated will generate messages including location that will be delivered to ICE numbers.
On selection of stranger use 5 s timer will pop up in the meantime you can cancel it if it's being called by an accident (Fig. 3).
Once the request has been sent, will be delivered to the ambulances available within 100 m radius but it's up to the driver whether he accepts. Google Maps and Google navigation APIs will allow the user to track both the real-time location of the driver and user's location. The contact details will be sent to the driver app so that the driver can arrive at a pinpoint location, as shown in Figs. 4 and 5.
On the other hand, there are two options available for calling the firefighters and police. In case of any mishap, the user doesn't need to remember any phone number: just press buttons on the screen to call (Fig. 3). Help Pro app also helps users in putting up the blood request such an option is available on the main interface called blood friend, it also enables the registered users to donate blood to the requested person. Donors will be notified through push notification or SMS and in a WhatsApp blood group (Fig. 6).
Google Maps APIs are adapted in such an orderly fashion that they can also show the nearby hospitals. In the case of car breakdown mechanics, contacts are fed into the application by the admin (Fig. 7). Most importantly, in a world of such rush usually, human beings do not have the essential contacts saved so pondering such act updated emergency SOS are also updated into the application. Keeping the importance of human lives, Help Pro will prove itself in providing the free and best services to human beings.

Driver Module
The second module of Help Pro app is the Driver module in which the driver will have to sign up using his credentials and ambulance data. Once an ambulance is requested by the user, Driver application will receive the applicant user data (Fig. 5). If the ambulance driver accepts, the app will start giving directions to the user's location. If not so, the request will automatically be transferred to another driver available within 100 m radius or nearest one of the users.

Admin Module
The last module of the Help Pro app is the Admin module, a web-based application built on Laravel (PHP framework) connected with the same Firebase database. The Admin interface is attractive and responsive to all screen sizes so the Admin module can be accessed from mobile browser as well. The Admin part is responsible for keeping and updating both applications' data. In order to log into the Admin module, there are a predefined credentials that can be edited later (email address and password). The Admin module can make the following changes to the application's data: • Admin can view and delete user's data and their profiles. • Admin can view and delete driver's data and their profiles. • Admin can insert and delete SOS numbers and details for the mechanic assistance facility. • Admin can view and delete user's alerts and feedback. Therefore, an admin user has all the privileges granted.

Algorithm and Implementation
We will discuss two important facts in this section. The first, is the algorithmic approach for the system. The second, is a schematic representation which can ease the understanding of the operation with Help Pro.

Algorithmic Design
The algorithm is chosen to equip the system with the ability to handle several emergency circumstances where multiple ambulances are required but only a few are available. We amalgamated the current scheduling method as a FCFS queue (First Come, First Served) with Dijkstra's algorithm to ensure a good system performance and to meet the users' requests [9]. The FCFS queue policy, processes the request of patients in the pipeline according to the concept of first to book, first to serve. Nevertheless, there are factors not considered as the distance to the patient's location or the seriousness of the patient's predicament. This concept is simple, but it has long-term, diversification, and holding consequences that affect the cost progression [10]. In contrast, Dijkstra's method seeks the shortest way between the user-selected source and a destination. In case of a high traffic situation, an alternative path with a new duration is determined. The Dijkstra algorithm is used in this application to help ambulances to discover people in need of emergency care when resources are insufficient [11]. In contrast, if only one ambulance is available on a given day and each patient's request is treated equally for the sake of visibility, it's critical to manage such instances as efficiently as possible.
Google Maps API uses the Dijkstra algorithm to steer a guiding GPS device to help us journey to our location by using different transports, giving estimations of traffic conditions and travel duration.

States Diagram
Help Pro system is operated by three important actors as a user: the patients, the ambulance driver, and the administrator of the system.
First of all, the application's use case diagram is attached below to show the activities and links of each system user. The diagram illustrates the accessibility of features to the patient, driver, and admin. Common links between the three actors are the registration process and login scenario into the system. According to Fig. 8, the main responsibility relays on drivers, as they must respond to the alert as soon as possible. Also, the admin user has an important role is because he must generate alerts and manages all requests.
Secondly, a level 2 data flow diagram is included in Fig. 9, to demonstrate the flow of data throughout the system. The format employed follows the approaching of a Firebase real-time database.
The coordinates of user and driver locations are stored in Firebase real-time data which we are getting through Google Map API. Similarly, the data like mechanics and hospital information, SOS (Save Our Souls) numbers, and details (text and images) filled in by users through in-app basic information form are also saved in Firebase real-time database and local storage. A sign-up authentication token is generated by Firebase authentication and sends through the Firebase cloud messaging service to the user's number.

Comparison
An application which resembles our application is "Mohafiz", that lets you communicate in a perilous situation by picking an action on screen. The case implemented is calling contacts "In Case of Emergency" through SMS, Facebook, and Twitter. After that, they will contact the emergency department by themselves [7]. Another similar application which is operational in India is "Call Ambulance" [8].
In this section, we will compare Help Pro's novelty, merits, superiority, and differences with other similar applications in the market.

Core Functionality
Help Pro is designed in such a way that a user can get facilitated for almost every emergency condition. It can save a lot of time and can avoid several constraints to reach the spot of the incident.
Unlike other apps, it is a one-link solution to almost every emergency service. As example, users have an option for real-time tracking for the ambulance service.

Responsive user Interface
Our logo in the app will remind you in your daily life routine the emergencies you could face. The logo itself represents our daily routine chorus. The design is simple, attractive, user-friendly, and responsive.

Tracking
Generally, we don't have any facilities to track the ambulance, call the police or call a firefighter. Also, we don't usually know the emergency service's location and how far they are from us. In other applications, we don't have the privilege to direct contact to the desired emergency depart itself so that without delaying anytime further we could get the help.
But with Help Pro, users can directly contact the emergency departments from where they are trying to get help. Users can track the live location of the ambulance by simply seeing it on the map integrated with our application. Ambulance drivers have a separate app to track users in trouble with on-screen map navigation.

Driver's Information
Generally, emergency applications do not provide any driver's information.
On the contrary, Help Pro provides you full privilege to know about your driver along with their full basic information so you could contact them if you are facing any sort of difficulty. The driver can also see its patient details like picture, name, and contact number.

Mechanic Facility
Generally, if we face any emergencies related to our vehicle or if our vehicles broke down, we have to call for our vehicle to be transported to the mechanic. In other apps, we usually don't see the option of a mechanic but in Help Pro, you could also find mechanics nearby you. Our app provides the user mechanic list near them which contains the name number and shop address of mechanics, helping to the user through any emergency related to vehicles.

Blood Donation
Generally, if we need blood or want to donate blood, we must search through blood banks, call friends and family: this all is quite awkward.
In Help Pro, with just one click we could send a request with a detailed message as a notification or by WhatsApp blood group at a time.

SOS List
Generally, our schedules are so hectic and our lives are so busy that we don't have time to even memorize some important emergency helpline numbers and if we face any emergency, we have to search for the numbers.
By using Help Pro, you can search through the emergency list of departments along with their contact or hotline numbers and addresses. The idea of our application is unique and easy to be implemented in this era of a smartphone in order to somehow contribute to saving someone's life free of cost at any time with just a single click. By presenting our idea in this paper, can be a highway for the thinker, innovators, and investors to contribute in an application or idea which can provide ease and help to humans in different scenarios or even in daily life. This work can become a boost to research work or ideas in areas which are still lacking like emergencies in underdeveloped countries.

Conclusion
The application developed gives access to essential services for individuals in this new time where everybody has occupied themselves around their life and nobody is tuning in to one's call for assistance. Help Pro provide a platform where people can alert their families and companions