SOS: An Android Application for Emergencies, Summaries of Applied Mathematics

This document details the development of an android application named sos, designed to send notifications during emergency or panic situations. The application utilizes location data, google maps api v2, and various android framework components. The project was developed as part of a master of science degree in department of computing and information sciences at kansas state university.

Typology: Summaries

2023/2024

Uploaded on 03/22/2024

mark-john-batasin-in
mark-john-batasin-in 🇵🇭

1 document

1 / 54

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SOS AN ANDROID APPLICATION FOR EMERGENCIES
By
AKASH SURYAWANSHI
B.E., SHRI GOVINDRAM SEKSARIA INSTITUTE OF TECH & SCIENCE, INDIA, 2010
A REPORT
Submitted in partial fulfillment of the requirements for the degree
MASTER OF SCIENCE
Department of Computing and Information Sciences
College of Engineering
KANSAS STATE UNIVERSITY
Manhattan, Kansas
2014
Approved by:
Major Professor
Dr. Daniel A. Andresen
brought to you by COREView metadata, citation and similar papers at core.ac.uk
provided by K-State Research Exchange
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download SOS: An Android Application for Emergencies and more Summaries Applied Mathematics in PDF only on Docsity!

SOS – AN ANDROID APPLICATION FOR EMERGENCIES

By

AKASH SURYAWANSHI

B.E., SHRI GOVINDRAM SEKSARIA INSTITUTE OF TECH & SCIENCE, INDIA, 2010

A REPORT

Submitted in partial fulfillment of the requirements for the degree

MASTER OF SCIENCE

Department of Computing and Information Sciences College of Engineering

KANSAS STATE UNIVERSITY

Manhattan, Kansas

2014 Approved by: Major Professor Dr. Daniel A. Andresen

View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by K-State Research Exchange

Abstract

The aim of the project is to develop an Android application that lets its users to send notifications in case of an emergency or a panic situation. The users can send multiple text messages and emails on the press of a single button. The phone numbers, email ids and the contents of the text and email messages can be set from within the application. The text messages and emails sent, along with the content, also have the last known location of the user. This is very helpful in tracking the whereabouts of the person. The user can also call 911 directly from within the application, if the nature of the situation demands it. Additionally the user of the application may allow the app to track their location. If this option is selected, the application fetches the device’s location at about every 15 minutes and stores it in a database. This information is very useful and can be used in a variety of ways. One such use of the location data is from within the Android app where the user can view a map that shows their location history over a period of time for a particular day.

v

vii

Acknowledgements

This project would not have been possible without the support and guidance of my Major Professor Dr. Daniel A. Andresen. I would like to extend my sincere gratitude to him for trusting in my abilities and providing me with an opportunity to work with him. He has been a source of immense knowledge, encouragement and provoked me to think innovatively. I would also like to express my special gratitude and thanks to Dr. Torben Amtoft and Dr. Mitchell L. Neilsen for serving on my committee and for their kind assistance and constant guidance. Finally, I would like to thank my family and friends for their endless support and motivation.

Chapter 1 - Introduction

SOS (which stands for Save Our Souls or Save Our Ships) has primarily been used as an International Morse code distress signal. It is commonly used in navigation by Sailors when under attack by Pirates or when they need help of some kind. But the signal is not limited to navigation and is used in a more general sense whenever a notification has to be sent about a situation that requires immediate attention.

1.1 Motivation

As much as we would like to get rid of them, panic or emergency situations are unavoidable and usually unexpected. The nature and consequences of these situations can vary significantly and in worst cases also be life threatening. Therefore it would be really nice to have some mechanism by which we can notify certain people about such circumstances and increase the chances of receiving help as soon as possible. The need for such a mechanism increases even more as in this era of technology, platforms exist to support them. One such platform and a very common one in that is a Smartphone. Almost everyone today carry a Smartphone with them as they become more and more affordable and easily available. Also within the Smartphone market Android is the clear leader in terms of market share. According to one report, 78.1 % of the total Smartphones sold in 2013 were the Smartphones that run on Android Operating System [1]. Hence developing an Android application becomes an obvious choice.

1.2 Project Description

SOS is an application that is meant to run on Android devices mainly smartphones but also tablets that support Cellular Service. The main functions and features of the application are – i. The user of the application has to login by entering a username and password the first time he opens the app on his device. He then remains logged into the application until he logs out explicitly. ii. If the user does not have an account, he can register on the login screen. iii. The user can also choose the password reset option in case he does not remember his password. A new password is set for the user and a mail containing this new password is sent to the registered email id.

Chapter 2 - Background

2.1 Android

Android is one of the most widely used Mobile Operating System today. It is a software bunch comprising not only of the Operating System but also middleware and key applications. Some of the most important features of an Android operating system is that it enables reuse and replacement of components, it is optimized for mobile devices and tablets, it is based on the open source Web kit engine and supports 2-D and 3-D graphics using OpenGL-ES standard.

2.1.1 Android Architecture

The Android operating system is implemented as a stack of different layers of software. The following image depicts these different layers:

Figure 2-1 Android Architecture [2]

Linux Kernel – This is the layer at the very bottom of the Android architecture. All other layers run on top of the Linux kernel and rely on this kernel to interact with the hardware. This layer contains all the essential hardware drivers which help to control and communicate with the hardware. It provides the basic functionality like Process Management, Memory Management and Device Management like Camera, Display, Flash etc. Libraries – This is a set of common functions of the application framework that enables the device to handle different types of data. Some of the most important set of libraries that are included are – Web kit which is the browser engine to display HTML, OpenGL used to render 2- D or 3-D graphics on to the screen, SQLite which is a useful repository for storing and sharing of application data. Android Runtime – The Android runtime mainly consist of the Dalvik Virtual Machine (DVM). DVM is very much like the standard Java Virtual Machine (JVM) except that it is optimized for mobile devices that have low processing power and low memory. DVM generates a .dex file from the .class file at compile time and provides higher efficiency in low resources devices. Each application has its own process and an instance of DVM. Android runtime also provides core libraries that enable the Android developers to create applications using the Java language. Application Framework- These are some standard class files that are available to the developer for use. An application can directly interact with them and make use of them. The application framework provides the most basic functionality of the phone like Location Manager, Content Providers etc. Applications – This is the topmost layer in the architecture and the layer where the application that we develop fits in. This layer provides several pre-installed applications that are default for certain things like Contacts Books, Browser etc.

To get an instance of google map you should call the getMap() function on a MapFragment object by GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(R.id. map )).getMap();

You can then add markers to this map by calling the addMarker() method on the map map.addMarker( new MarkerOptions() .title(address) .position( new LatLng(latitude, longitude)) .snippet(time));

2.3 PHP PHP is one of the most popular server side scripting language. Php scripts can be embedded into the HTML pages. The start and the end tags for a PHP script are respectively. PHP pages can contain text, HTML, CSS, JavaScript and more. They have the .php extension and are executed on the server.

PHP can be help you get the following things done – i. Create dynamic web pages by generating data based on user requests. ii. Collect and process data from forms submitted by the user. iii. Work with files on the server iv. Manipulate some database v. Send and receive cookies etc. Apart from the above reasons PHP can run on various platforms and is compatible with almost all server in use. It is free and has a big support community.

2.4 MySQL It is one of the most widely used Relational database management system (RDBMS). It is open source and available for free. It scales very well for large quantities of data, is fast, reliable and easy to use. Like most other RDBMS it uses structured query language (SQL) for accessing and manipulating data.

2.5 JSON JSON stands for JavaScript Object Notation. It is a light weight format for storing and exchanging objects that contain name/value pairs, array and other objects. It is language independent i.e. although it uses JavaScript syntax, it is still language and platform independent and many different languages support JSON parsers and libraries. The two main advantages of JSON over other ways of exchanging data like XML are – i. JSON is usually smaller than the corresponding XML. ii. JSON is easier to parse and faster.

For example – { “products”:[ {“id”: 1, “name”:”car”}, { “id”:2, “name”:”truck”} ] } The above JSON has two products (JSONArray) where each product is an Object (JSONObject) with keys id and name and their corresponding values.

v. The user shall be able to set the contacts to send text message and email from within the application. The user must also be able to set the contents of the messages. Also the user may select these contacts from the contact book or enter them manually. vi. The user shall be able to start/stop location tracking. They must also be able to see their location history from within the application. Other non-functional requirements for the application are – i. Providing a simple and elegant UI for the main screen. This is necessary as the user would usually come on to this screen in case of a panic or emergency and hence each button should be clearly visible and easily pressed. ii. In case the option to track location is selected and there is no internet connectivity on the device (both wireless and Cellular data), the application should be able to store the locations offline and send them to be stored in the database once the internet connectivity is up again. iii. Providing a tab based view to display the different setting for the application and location history for the user. iv. Enabling swipe gestures for the tabbed view. v. Displaying user friendly dialogs for picking the date, time, entering the contacts to send text and email messages to and to enter the contents of the text and email messages.

3.2 Requirement Specifications

3.2.1 Software Requirements

These requirements are separated based on whether you are developing the app or running the app on a device. For development: Operating System: Windows XP or higher/Mac OS X 15.8 or later/Linux Platform: Android SDK Framework 10 or higher Tools: Eclipse SDK 3.5, ADT plug-in for eclipse Technologies used: Java, SQLite, Android, Google maps v2 API Debugger: Android Dalvik Debug Monitor Service (DDMS) Android Emulator: API level 14 or higher

For running on a device: Operating System: Android 3.0 or higher Cellular capabilities for SMS messages

3.2.2 Hardware Requirements

For development: Processor: Intel Pentium IV or higher RAM:256MB Space on disk: 250 MB (at the least) For running on a de vice: Device: Phone or tablet running Android 3.0 or higher Disk space: 6 MB (at the least)

For example, a file called Map.java will make use of Google maps Android API v2 to connect the Android app with Google Maps Engine to render map and markers of them. iv. Services – This is the component of the application that is typically used to perform long background tasks that do not have a user interface. For example – a service is used to track the location of the device at every fixed interval of time. v. Receivers – This is the component of the application that typically listens for some events or responses from other services. For example – A receiver is used to fetch the location co-ordinates from the location service and then add this location to the database for future references. vi. SQLite – Android platform provides libraries for SQLite database. A SQLite database is a relational database that is local to an Android device. It requires no configuration and is available to use for an app developer. For example – SQLite is used in the app to store various information about a user, his last known location or in case there is no internet connectivity SQLite database stores the location until the internet connection is back up and the records are sent to the database. vii. Location Manager – It is used to fetch the location of the Android device. The app uses both the GPS provider and the network provider to find the location for the device. GPS provides more accurate data about the location but usually takes sufficient time to start up after the connection is relinquished. Network provider on the other hand are quicker but the accuracy is lesser than GPS. viii. Contacts Manager – A system service that provides the contact to use so that the user can select a contact that is already present in the contact book. When the user clicks on the number text box to enter a number it opens up the contact book application. If the user selects a contact and if that contact has a number associated, it is send to the SOS application and displayed in these text boxes. ix. Connectivity status manager- This system service tells the SOS application about changes in the connectivity status for the device. The application uses it to make sure that if there is no active internet connection on the device at the time of sending the fetched location to the database, it needs to store the location in the SQLite database. The application should also listen to the connectivity manager to make sure that once the internet is up

again all the locations that are stored in the SQLite database are sent over to the database on the server and then the SQLite database is cleared. x. Google Maps Engine – SOS app uses google maps Android API v2 to work with maps. When this API is used, calls are made to the google maps engine to fetch the map or place various markers on it. xi. PHP Scripts – The SOS app sends JSON objects to various PHP scripts using HTTP POST methods. These scripts interact with the database on the server to give a response to the app. For example- When the user logs into the application a JSON object is created that contains the values that the user entered into the app. This JSON is sent to a PHP script login.php on the server that queries the DB to validate the user. If the user credentials are valid a success response is sent back to the SOS app. xii. Database- This is the MySQL database on the server. It is used to permanently store the data for the SOS app. It stores information of various user, location history etc.

4.2 Design Diagrams

4.2.1 Use case diagrams A use case diagram is used to specify the functionality of the system from the point of view of a user. Each use case describes a logical task that may be performed by a user. It mainly shows the interaction between the system and the outside world.

1. Use case for location tracking and fetching location history

Figure 4-2 Use case diagram - 1