demo project example

34
 ANDROID - BASED ALARM MANAGEMENT SYSTEM FOR INDUSTRIES

Upload: mehul-joshi

Post on 02-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 1/34

 

ANDROID - BASED

ALARM MANAGEMENT

SYSTEM FOR

INDUSTRIES

Page 2: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 2/34

 

SATHYABAMA UNIVERSITY(Established under Section 3 of UGC Act, 1956)

JEPPIAAR NAGAR, RAJIV GANDHI SALAI, 600 119

www.sathyabamauniversity.ac.in

DEPARTMENT OF _________________________________________

BONAFIDE CERTIFICATE

This is to certify that this Project Report is the Bonafide work of Mr./Ms.

 __________________________________________________ Reg. No.

 _______________________________ who carried out the project entitled

“_________________  _______________________________  _________________”

under our supervision from _______ to ______________.

Internal Guide External Guide(Name in Capital letters (Name in Capital letters 

with Signature) with signature) 

Head of the Department

(Name in Capital letters with Seal & Signature)

Submitted for Viva voce Examination held on_____________________

Internal Examiner External Examiner

(Name in Capital letters (Name in Capital letters 

with Signature) with signature) 

Page 3: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 3/34

 

DECLARATION

I ______________________(Name/s of the Candidate)_________________ hereby

declare that the Project Report entitled

„ ______________________________________________ done by me under the

guidance of Dr. /Prof./ Mr./Ms. ___________(Internal) at

 ____________________________________________________________ is submitted

in partial fulfillment of the requirements for the award of degree in

 _______________________________.

DATE:

PLACE: SIGNATURE OF THE CANDIDATE/S

Page 4: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 4/34

 

ACKNOWLEDGEMENT

This project was successfully completed not without the support and guidance of a

number of people from our university.

Therefore, I would like to thank our chancellor, Col. Dr. JEPPIAAR, M.A., B.L., Ph.D.,

for his enduring support and encouragement. 

I also thank our directors, Thiru. Marie Johnson, B.E., M.B.A., M.Phil. (Ph.D.) and

Tmt. Mariazeena Johnson, B.E., M.B.A., M.Phil, (Ph.D.) for their continued support

throughout.

I also acknowledge and thank the support and guidance extended by our vice

chancellor, Dr. B. Sheela Rani, M.S (By Research)., Ph.D. 

I would also like to thank the Head of our Department, the Department of Electronics

and Communication, Dr. Lokashanmugam, (Ph.D.), as well as each and every other

faculty member in our department who helped as at some point or the other. Our very

special thanks and gratitude to our internal guide, Mr. S. Karthikeyan, Assistant

Professor, Department of ECE, for his immense encouragement, great ideas and

innovative inputs.

Page 5: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 5/34

 

CONTENTS

SNo.

Title PageNo.

Abstract (i)

2) Chapter 1: Introduction -1.1: Java1.2: Android1.3: GSM1.4: Eclipse

1

3) Chapter 2: Aim and scope of Android-based Alarm System2.1: Industrial Hazards and safety2.2: Why use Android?2.3: Basic Implementation of the Alarm System

4) Chapter 3: Core Structure and Architecture3.1: Architecture – s/w & h/w3.2: Code structure/ Algorithm3.3: Code design

5) Chapter 4: Practical results, Data and Advantages

6) Chapter 5: Conclusion

7) Bibliography

Page 6: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 6/34

 

ABSTRACT

ANDROID BASED ALARM MANAGEMENT SYSTEM FOR

INDUSTRIES.

This paper presents Android-based SoD (System on Demand) client for remote

presentation in a virtual desktop environment. SoD is the framework for on-demand

computing in virtual computing environment.The objective of this paper is providing an

 Android based smart phone with SoD client functions by which breaches of predefined

parameter constraints in an industrial environment are detected by a centrally synced

hub and instantaneously transmitted to the smart phone. Implemented SoD client is

tested on virtual desktop environment consisting of a Xen hypervisor, Windows-based

guest virtual machines. The challenge point of this paper is syncing the desktopenvironment to the SoD interface. After this, we can redirect each virtualized I/O to any

SoD client device on demand, in this case a smart phone working on an Android OS.

Page 7: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 7/34

 

CHAPTER ONE: INTRODUCTION

1.1: JAVA

Java is a programming language originally developed by James Gosling at Sun Microsystems

(which has since merged into Oracle Corporation) and released in 1995 as a core component ofSun Microsystems' Java platform. The language derives much of its syntax from C and C++ but

has a simpler object model and fewer low-level facilities. Java applications are typically

compiled to byte code (class file) that can run on any Java Virtual Machine (JVM) regardless of

computer architecture. Java is a general-purpose, concurrent, class-based, object-orientedlanguage that is specifically designed to have as few implementation dependencies as possible. It

is intended to let application developers "write once, run anywhere" (WORA), meaning that code

that runs on one platform does not need to be recompiled to run on another. Java is currently oneof the most popular programming languages in use, particularly for client-server webapplications, with a reported 10 million users.

1.1.1: Pri nciples of java.

There were five primary goals in the creation of the Java language:

1.  It should be "simple, object-oriented and familiar"

2.  It should be "robust and secure"3.  It should be "architecture-neutral and portable"4.  It should execute with "high performance"

5.  It should be "interpreted, threaded, and dynamic.” 

1.1.2: Versions.

Major release versions of Java, along with their release dates:

  JDK 1.0 (January 23, 1996)  JDK 1.1 (February 19, 1997)

  J2SE 1.2 (December 8, 1998)

  J2SE 1.3 (May 8, 2000)

  J2SE 1.4 (February 6, 2002)

  J2SE 5.0 (September 30, 2004)

  Java SE 6 (December 11, 2006)

  Java SE 7 (July 28, 2011)

Page 8: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 8/34

 

1.1.3: The Java platform.

One characteristic of Java is portability, which means that computer programs written in the Java

language must run similarly on any hardware/operating-system platform. This is achieved bycompiling the Java language code to an intermediate representation called Java bytecode, instead

of directly to platform-specific machine code. Java bytecode instructions are analogous to

machine code, but are intended to be interpreted by a virtual machine (VM) written specificallyfor the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on

their own machine for standalone Java applications, or in a Web browser for Java applets.

Standardized libraries provide a generic way to access host-specific features such as graphics,threading, and networking.

A major benefit of using bytecode is porting. However, the overhead of interpretation means thatinterpreted programs almost always run more slowly than programs compiled to native

executables would. Just-in-Time (JIT) compilers were introduced from an early stage that

compile bytecodes to machine code during runtime.

1.1.4: Advantages of using Java.

1. It is available to anybody and is easy to program.

2. It is an advanced language though syntax is based on classic programming languages like C orC++.

3. Most of the systems (reportedly, 1-2 billion devices) are dependent directly or indirectly on

 java.

4. It can implemented on tested software such as eclipse.

1.2: ANDROID

Android is a Linux-based operating system for mobile devices such as smartphones and tablet

computers. It is developed by the Open Handset Alliance led by Google.

Google purchased the initial developer of the software, Android Inc., in 2005. The unveiling of

the Android distribution in 2007 was announced with the founding of the Open HandsetAlliance, a consortium of 86 hardware, software, and telecommunication companies devoted to

Page 9: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 9/34

 

advancing open standards for mobile devices Google releases the Android code as open-source,

under the Apache License. The Android Open Source Project (AOSP) is tasked with the

maintenance and further development of Android.

Android has a large community of developers writing applications ("apps") that extend the

functionality of the devices. Developers write primarily in a customized version of Java. Appscan be downloaded from third-party sites or through online stores such as Google Play (formerly

 Android Market ), the app store run by Google. As of February 2012 there were more than

450,000 apps available for Android, and the estimated number of applications downloaded fromthe Android Market as of December 2011 exceeded 10 billion.

1.2.1: Versions.

Android has seen a number of updates since its original release, each fixing bugs and adding new

features. Each version is named, in alphabetical order, after a dessert.

Recent releases

  2.3 Gingerbread refined the user interface, improved the soft keyboard and copy/paste

features, improved gaming performance, added SIP support (VoIP calls), and added

support for Near Field Communication.

  3.0 Honeycomb was a tablet-oriented release which supports larger screen devices and

introduces many new user interface features, support for multi core processors, hardware

acceleration for graphics and full system encryption. The first device featuring this

version, the Motorola Xoom tablet, went on sale in February 2011.

  3.1 Honeycomb, released in May 2011, added support for extra input devices,

USB host mode for transferring information directly from cameras and otherdevices, and the Google Movies and Books apps.

  3.2 Honeycomb, released in July 2011, added optimization for a broader range ofscreen sizes, new "zoom-to-fill" screen compatibility mode, loading media files

directly from SD card, and an extended screen support API. Huaweiad is the first

7 inch tablet to use this version.

  4.0 Ice Cream Sandwich, announced on October 19, 2011, brought Honeycomb features

to smartphones and added new features including facial recognition unlock, network datausage monitoring and control, unified social networking contacts, photography

enhancements, offline email searching, app folders, and information sharing using NFC.

Android 4.0.3 Ice Cream Sandwich is the latest Android version that is available to phones. The source code of Android 4.0.1 was released on November 14, 2011.

Page 10: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 10/34

 

1.2.2: Features.

Current features and specifications:

 Handset layouts

The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on

OpenGL ES 2.0 specifications, and traditional smartphone layouts.

Storage

SQLite, a lightweight relational database, is used for data storage purposes.

Connectivity

Android supports connectivity technologies including GSM/EDGE, IDEN, CDMA, EV-DO,

UMTS, Bluetooth, Wi-Fi, LTE, NFC and WiMAX.

 Messaging

SMS and MMS are available forms of messaging, including threaded text messaging and now

Android Cloud To Device Messaging (C2DM) is also a part of Android Push Messaging service.

 Multiple language support

Android supports multiple languages.

Web browser

The web browser available in Android is based on the open-source WebKit layout engine,coupled with Chrome's V8 JavaScript engine. The browser scores 100/100 on the Acid3 test on

Android 4.0.

 Java support

While most Android applications are written in Java, there is no Java Virtual Machine in the

 platform and Java byte code is not executed. Java classes are compiled into Dalvik executablesand run on Dalvik, a specialized virtual machine designed specifically for Android and optimized

for battery-powered mobile devices with limited memory and CPU. J2ME support can be

 provided via third-party applications.

Page 11: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 11/34

 

 Media support

Android supports the following audio/video/still media formats: WebM, H.263, H.264 (in 3GP

or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC, HE-AAC (in MP4or 3GP container), MP3, MIDI, Ogg Vorbis, FLAC, WAV, JPEG, PNG, GIF, BMP.

Streaming media support

RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive download (HTML5 <video>tag). Adobe Flash Streaming (RTMP) and HTTP Dynamic Streaming are supported by the Flash

 plugin. Apple HTTP Live Streaming is supported by RealPlayer for Android, and by the

operating system in Android 3.0 (Honeycomb).

 Additional hardware support

Android can use video/still cameras, touchscreens, GPS, accelerometers, gyroscopes,

 barometers, magnetometers, dedicated gaming controls, proximity and pressure sensors,

thermometers, accelerated 2D bit blits (with hardware orientation, scaling, pixel formatconversion) and accelerated 3D graphics.

 Multi-touch

Android has native support for multi-touch which was initially made available in handsets

such as the HTC Hero. The feature was originally disabled at the kernel level (possibly to avoidinfringing Apple's patents on touch-screen technology at the time). Google has since released an

update for the Nexus One and the Motorola Droid which enables multi-touch natively.

 Bluetooth

Supports A2DP, AVRCP, sending files (OPP), accessing the phone book (PBAP), voicedialing and sending contacts between phones. Keyboard, mouse and joystick (HID) support is

available in Android 3.1+, and in earlier versions through manufacturer customizations and third-

 party applications.

Video calling

Android does not support native video calling, but some handsets have a customized version

of the operating system that supports it, either via the UMTS network (like the Samsung Galaxy

S) or over IP. Video calling through Google Talk is available in Android 2.3.4 and later.Gingerbread allows Nexus S to place Internet calls with a SIP account. This allows for enhanced

VoIP dialing to other SIP accounts and even phone numbers. Skype 2.1 offers video calling in

Android 2.3, including front camera support.

Page 12: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 12/34

Page 13: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 13/34

 

generation (4G) LTE Advanced standards. "GSM" is a trademark owned by the GSM

Association.

1.3.1: Technical detail s.

GSM is a cellular network, which means that cell phones connect to it by searching for cells inthe immediate vicinity. There are five different cell sizes in a GSM network  — macro, micro,

 pico, femto and umbrella cells. The coverage area of each cell varies according to the

implementation environment. Macro cells can be regarded as cells where the base station antennais installed on a mast or a building above average roof top level. Micro cells are cells whose

antenna height is under average roof top level; they are typically used in urban areas. Picocells

are small cells whose coverage diameter is a few dozen metres; they are mainly used indoors.

Femtocells are cells designed for use in residential or small business environments and connect

to the service provider’s network via a broadband internet connection. Umbrella cells are used to

cover shadowed regions of smaller cells and fill in gaps in coverage between those cells.

Cell horizontal radius varies depending on antenna height, antenna gain and propagationconditions from a couple of hundred metres to several tens of kilometres. The longest distance

the GSM specification supports in practical use is 35 kilometres (22 mi). There are also several

implementations of the concept of an extended cell, where the cell radius could be double oreven more, depending on the antenna system, the type of terrain and the timing advance.

Indoor coverage is also supported by GSM and may be achieved by using an indoor picocell base

station, or an indoor repeater with distributed indoor antennas fed through power splitters, todeliver the radio signals from an antenna outdoors to the separate indoor distributed antenna

system. These are typically deployed when a lot of call capacity is needed indoors; for example,

in shopping centers or airports. However, this is not a prerequisite, since indoor coverage is also provided by in-building penetration of the radio signals from any nearby cell.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK), a kind of continuous-

 phase frequency shift keying. In GMSK, the signal to be modulated onto the carrier is firstsmoothed with a Gaussian low-pass filter prior to being fed to a frequency modulator, which

greatly reduces the interference to neighboring channels (adjacent-channel interference).

1.3.2: Network structur e.

Page 14: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 14/34

 

The network is structured into a number of discrete sections:

The Base Station Subsystem (the base stations and their controllers).

The Network and Switching Subsystem (the part of the network most similar to a fixed

network). This is sometimes also just called the core network.

The GPRS Core Network (the optional part which allows packet based Internet connections).

The Operations support system (OSS) for maintenance of the network.

1.3.3: Subscriber I denti ty Module.

One of the key features of GSM is the Subscriber Identity Module, commonly known as a SIM

card. The SIM is a detachable smart card containing the user's subscription information and phone book. This allows the user to retain his or her information after switching handsets.

Alternatively, the user can also change operators while retaining the handset simply by changing

the SIM. Some operators will block this by allowing the phone to use only a single SIM, or only

a SIM issued by them; this practice is known as SIM locking.

Page 15: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 15/34

Page 16: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 16/34

 

The initial codebase originated from VisualAge. The Eclipse SDK (which includes the Java

development tools) is meant for Java developers. Users can extend its abilities by installing plug-

ins written for the Eclipse Platform, such as development toolkits for other programminglanguages, and can write and contribute their own plug-in modules.

1.4.1: Versions.

Since 2006, the Foundation has coordinated an annual Simultaneous Release. Each release

includes the Eclipse Platform as well as a number of other Eclipse projects.

So far, each Simultaneous Release has occurred on the fourth Wednesday of June.

Codename Date Platform version Projects

? 21 June 2004 3.0

? 28 June 2005 3.1

Callisto 30 June 2006 3.2 Callisto projects  

Europa 29 June 2007 3.3 Europa projects 

Ganymede 25 June 2008 3.4 Ganymede projects  

Galileo 24 June 2009 3.5 Galileo projects  

Helios 23 June 2010 3.6 Helios projects  

Indigo 22 June 2011 3.7 Indigo projects  

Juno 27 June 2012 3.8 and 4.2 Juno projects  

Kepler June 2013 (planned) 4.xx Kepler projects  

1.4.1: Architecture

The Eclipse Platform uses plug-ins to provide all functionality within and on top of the runtime

system, in contrast to some other applications, in which functionality is hard coded. The Eclipse

Platform's runtime system is based on Equinox, an implementation of the OSGi core frameworkspecification.

This plug-in mechanism is a lightweight software componentry framework. In addition toallowing the Eclipse Platform to be extended using other programming languages such as C and

Python, the plug-in framework allows the Eclipse Platform to work with typesetting languages

like LaTeX,[13] networking applications such as telnet and database management systems. The plug-in architecture supports writing any desired extension to the environment, such as for

Page 17: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 17/34

 

configuration management. Java and CVS support is provided in the Eclipse SDK, with support

for other version control systems provided by third-party plug-ins.

With the exception of a small run-time kernel, everything in Eclipse is a plug-in. This means thatevery plug-in developed integrates with Eclipse in exactly the same way as other plug-ins; in this

respect, all features are "created equal".[citation needed] Eclipse provides plug-ins for a wide

variety of features, some of which are through third parties using both free and commercialmodels. Examples of plug-ins include a UML plug-in for Sequence and other UML diagrams, a

 plug-in for DB Explorer, and many others.

The Eclipse SDK includes the Eclipse Java development tools (JDT), offering an IDE with a built-in incremental Java compiler and a full model of the Java source files. This allows for

advanced refactoring techniques and code analysis. The IDE also makes use of a workspace, inthis case a set of metadata over a flat filespace allowing external file modifications as long as thecorresponding workspace "resource" is refreshed afterwards.

Eclipse implements widgets through a widget toolkit for Java called SWT, unlike most Javaapplications, which use the Java standard Abstract Window Toolkit (AWT) or Swing. Eclipse's

user interface also uses an intermediate graphical user interface layer called JFace, which

simplifies the construction of applications based on SWT.

Language packs provide translations into over a dozen natural languages.

Page 18: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 18/34

 

CHAPTER TWO: AIM & SCOPE OF ANDROID BASED ALARM SYSTEM

2.1: Industrial Hazards and Safety

Hazard is a term associated with a substance that is likely to cause an injury in a givenenvironment or situation. A hazard is something that can cause harm if not controlled. Industrial

hazard may be defined as any condition produced by industries that may cause injury or death to

 personnel or loss of product or property. Safety in simple terms means freedom from theoccurrence of risk or injury or loss. Industrial safety refers to the protection of workers from the

danger of industrial accidents. Occupational health and safety has come a long way from its

 beginnings in the heavy industry sector. It now has an impact on every worker, in every work

 place, and those charged with managing health and safety are having more and more tasks addedto their portfolio. The most significant responsibility is environmental protection. The skills

required to manage occupational health and safety are compatible with environmental protection,

which is why these responsibilities are so often bolted onto the workplace health and safety professional.

Hazard analysis or hazard assessment is a process in which individual hazards of the workplaceare identified, assessed and controlled/eliminated as close to source (location of the hazard) as

reasonable and possible. As technology, resources, social expectation or regulatory requirements

change, hazard analysis focuses controls more closely toward the source of the hazard. Thus

hazard control is a dynamic program of prevention. Hazard-based programs also have theadvantage of not assigning or implying there are "acceptable risks" in the workplace. A hazard-

 based program may not be able to eliminate all risks, but neither does it accept "satisfactory" --

 but still risky — outcomes. And as those who calculate and manage the risk are usually managerswhile those exposed to the risks are a different group, workers, a hazard-based approach can by-

 pass conflict inherent in a risk-based approach. In this system, the analyzed hazard data is sent

immediately to the android device from the processing database, thus ensuring prompt correct or

 prevention from the hazard manager.

During the last several decades there has been a growing awareness of the expanding risks and

consequences of major industrial disasters. This is reflected in official statistics, mass media

reports, and the appearance of new public institutions that address the problem. The growth of

industrial accident prevention companies and the blossoming of literature on industrial risk

assessment are other expressions of the same.

Page 19: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 19/34

 

Industrial disasters are not simply safety problems that need to be resolved; they also have a

wider significance because they offer important opportunities to learn about the "goodness of fit"

 between society, technology, and environment and about how that fit can be strengthened or

weakened by unexpected events. This is the kind of information that will be invaluable to

humanity during an era of deep and far-reaching societal and environmental change. However, if

we are to make optimal use of such opportunities it may be necessary to modify the way we

think about industrial disasters.

It is customary to view industrial disasters as "extreme events" that are different mainly in degree

from more mundane disruptions to which industries and society have become adjusted. This

chapter asserts that it is time to make a clear distinction between two types of industrial disasters

- "routine" disasters and "surprises". As defined here, routine disasters are well understood by

experts and susceptible to management using long-established principles and practices. They

constitute the great majority of threats to human populations. Successful management of routinedisasters mainly requires that society put into practice the ample stocks of knowledge and

experience about them that already exist. Surprises, which confound both expert and lay

expectations, are quite different and much less understood. They include disasters like Bhopal

and Chernobyl and Minamata events or their consequences or both - that lie outside the realm of

 previous experience. These are the sort of disasters we are looking to avoid.

It is advantageous to think of surprises as a coherent class of events that cuts across all types of

hazards, rather than as extreme events that lie at the tails of different sets of statistical

distributions. Since surprises appear to be increasing, it is important to develop better ways of

responding to them. Because surprises are unprecedented events, it is difficult to design specificanticipatory measures of the kind that have proved successful in reducing routine hazards.

Improving reactive responses to surprises may offer better opportunities for coping with

surprises, at least in the short run. Communities that have been affected by surprises should learn

from each other's experience and disseminate that knowledge widely. By so doing, it may be

 possible to identify responses that are robust and flexible across a range of different surprises and

therefore worthy of encouragement and emulation in communities elsewhere.

2.1.1: The nature of industrial disasters

Industrial hazards are threats to people and life-support systems that arise from the mass

 production of goods and services. When these threats exceed human coping capabilities or the

absorptive capacities of environmental systems they give rise to industrial disasters. Industrial

hazards can occur at any stage in the production process, including extraction, processing,

manufacture, transportation, storage, use, and disposal. Losses generally involve the release of

damaging substances (e.g. chemicals, radioactivity, and genetic materials) or damaging levels of

Page 20: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 20/34

Page 21: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 21/34

 

Fig. 2.1 Components of industrial hazards

The fact that most communities survive industrial disasters testifies to the resilience of people

and the effectiveness of their responses to catastrophe. Indeed, over the long term, humans have

demonstrated impressive abilities to cope with most industrial disasters, first by ameliorating

their effects and then by finding effective ways to avoid, prevent, or control them by

 precautionary actions. Boiler explosions provide a good illustration. At one time in the early

industrialization of Great Britain and the United States, boiler explosions were perhaps the most

common industrial disaster. They often led to catastrophic fires on board ships and trains as well

as in factories, apartment buildings, and other places. Now the problem of boiler explosions is

much reduced as a consequence of improvements in industrial design, construction standards,

worker safety, occupational health, and other factors. Similar improvements have reduced the

hazard of fires caused by faulty electrical equipment and the number of collapses of high-rise

Page 22: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 22/34

 

 buildings. Another more recent example has come to light in the wake of hurricane Andrew, the

most disastrous storm ever to have affected the United States. Despite Andrew's size, intensity,

and general destructiveness on land, it destroyed or damaged very few offshore oil and gas

 platforms. This positive outcome continues a long-term trend of improvement in platform

survivability that has come about because of advances in knowledge about marine environments,

design standards, building materials and construction practices, platform siting and installation

 procedures, and improved operation and maintenance actions.

As these examples show, though they may be long lived, industrial hazards are neither

 permanent nor unchanging. The mix of hazard is always in flux. New hazards arise as a

consequence of technological innovations, while existing hazards are reduced or eliminated by

effective human responses. Through time, whole classes of hazard may be added to or dropped

from the public agenda. Kirk Smith, a researcher at the East-West Center in Hawaii, argues that

this process of change might be labeled "risk transition" and that it is comparable in importance

to the so called "demographic transition" that accompanied rapid economic development in many

countries during the past century.

So-called "man-made catastrophes" occur with considerable frequency throughout the world

every year (fig 2.2). But sprinkled here and there throughout the record is another kind of event,

one that brings to light new and troubling dimensions of disaster. These can be labeled

"surprises". Surprises are events that confound our expectations .In the context of this subject

they are also events that announce unprecedented hazards. In the lists of major disasters there

may be only a few surprises each year but they are among the most important events. Progress in

understanding - let alone managing - surprises is slow and limited.

Page 23: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 23/34

Page 24: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 24/34

 

Some surprises are unprecedented because they are one of a kind. For example, Kyshtym appears

to be the only significant example of a nuclear waste storage disaster; perhaps there will never be

another like it.

Other surprises are unprecedented because they are the first of a kind, each the precursor of what

later turns out to be a sequence of related events. The destruction in flight of the world's firstcommercial jet airliner - the British Comet - is an example: a series of apparently mysterious

Comet crashes occurred at intervals until a lengthy investigation disclosed that metal fatigue was

an unexpectedly serious problem in these aircraft. The sinking of the Torrey Canyon off the

United Kingdom in the early 1970s was the first in a series of supertanker oil spills that brought

increasingly greater damage to maritime ecosystems. Within a few years, much larger cargoes of

oil were fetching up on vulnerable shores. A third type of surprise gains notoriety from being a

worst of a kind event. Chernobyl stands as the worst in a series of nuclear power station

accidents that includes earlier events like the Wind scale incident (1957) and the accident at

Three Mile Island (1979). Although it is currently the worst event of its kind, there is potential

for others. A recent US General Accounting Office report indicates that 40 old Soviet-designed

nuclear reactors without basic safety features are still operating in Russia and Eastern Europe.

Ten of these are of special concern.

It is also possible to classify surprises in terms of the degree to which they are susceptible to

 prediction and control. Here, three groups of hazards stand out:

i) Unsuspected hazards,

ii) Improperly managed hazards,

iii) Instrumental hazards.

Unsuspected hazards involve substances or activities that were regarded as harmless or benign

until scientific evidence or human experience showed otherwise. DDT, asbestos, and chemical

chlorofluorocarbons are representative examples. Improperly managed hazards involve failures

of various kinds of hazard control systems. Most major industrial accidents are of this type.

Well-known management failures have taken place at nuclear facilities (e.g. Windscale, Three

Mile Island, Chernobyl), chemical plants (e.g. Seveso, Basle, Bhopal), and transportation

systems (e.g. Challenger, Exxon Valdez), as well as in storage and disposal sites for toxic

materials (e.g. Kyshtym, Times Beach, Love Canal, Minamata). Instrumental hazards are

intended to cause harm and are consciously employed towards that end. They include sabotage,

arson, and warfare. Military industrial technologies belong to this group (e.g. nuclear, biological,

and chemical weapons such as defoliants and nerve agents; deliberate oil spills and oilfield

conflagrations). The mismanaged wastes of military industrial technology are also an important

form of improperly managed hazards.

Page 25: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 25/34

Page 26: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 26/34

 

2.2: Why use Android?

Android is an absolutely open source software stack for mobile devices that includes an

operating system, middleware and key applications. The Android SDK provides the tools and

APIs necessary to begin developing applications on the Android platform using the Java

 programming language. A number of Integrated Development Environments(IDE) are availableto code, compile or test any desired software on the Android platform.

Fig 2.3: Android Architecture

As shown in the architecture diagram, each component of the android architecture build is available to a

 programmer to use, reuse, or modify. All applications are written using the Java programming language.

By providing an open development platform, Android offers developers the ability to build extremely richand innovative applications. Developers are free to take advantage of the device hardware, access location

information, run background services, set alarms, add notifications to the status bar, and much, much

more.

Developers have full access to the same framework APIs used by the core applications. The application

architecture is designed to simplify the reuse of components; any application can publish its capabilities

Page 27: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 27/34

 

and any other application may then make use of those capabilities (subject to security constraints enforced

 by the framework). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

i)  A rich and extensible set of Views that can be used to build an application, including

lists, grids, text boxes, buttons, and even an embeddable web browser

ii)  Content Providers that enable applications to access data from other applications

(such as Contacts), or to share their own data

iii)  A Resource Manager, providing access to non-code resources such as localized

strings, graphics, and layout files

iv)  A Notification Manager that enables all applications to display custom alerts in the

status bar

v)  An Activity Manager that manages the lifecycle of applications and provides a

common navigation backstack

Libraries

Android includes a set of C/C++ libraries used by various components of the Android system. These

capabilities are exposed to developers through the Android application framework. Some of the core

libraries are listed below:

i)  System C library - a BSD-derived implementation of the standard C system library

(libc), tuned for embedded Linux-based devices

ii)  Media Libraries - based on PacketVideo's OpenCORE; the libraries support playbackand recording of many popular audio and video formats, as well as static image files,

including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG

iii)  Surface Manager - manages access to the display subsystem and seamlessly

composites 2D and 3D graphic layers from multiple applications

iv)  LibWebCore - a modern web browser engine which powers both the Android

 browser and an embeddable web view

v)  SGL - the underlying 2D graphics engine

vi)  3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use

either hardware 3D acceleration (where available) or the included, highly optimized

3D software rasterizer

vii)  FreeType - bitmap and vector font rendering

viii)  SQLite - a powerful and lightweight relational database engine available to all

applications

Page 28: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 28/34

 

Android Runtime

Android includes a set of core libraries that provides most of the functionality available in the core

libraries of the Java programming language.

Every Android application runs in its own process, with its own instance of the Dalvik virtual machine.

Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files

in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is

register-based, and runs classes compiled by a Java language compiler that have been transformed into the

.dex format by the included "dx" tool.

The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level

memory management.

Linux Kernel

Android relies on Linux version 2.6 for core system services such as security, memory management,

 process management, network stack, and driver model. The kernel also acts as an abstraction layer

 between the hardware and the rest of the software stack.

Dalvik

Dalvik is the process virtual machine (VM) in Google's Android operating system. It is the

software that runs the apps on Android devices. Dalvik is thus an integral part of Android, which

is typically used on mobile devices such as mobile phones and tablet computers. Programs are

commonly written in a dialect of Java and compiled to byte code. Then they are converted from

Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files

 before installation on a device. The compact Dalvik Executable format is designed to be suitable

for systems that are constrained in terms of memory and processor speed.

Application Fundamentals

Android applications are written in the Java programming language. The Android SDK tools

compile the code, along with any data and resource files, into an Android package, an archivefile with an .apk suffix. All the code in a single .apk file is considered to be one application and

is the file that Android-powered devices use to install the application.

Page 29: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 29/34

 

Once installed on a device, each Android application lives in its own security sandbox. The

Android operating system is a multi-user Linux system in which each application is a different

user. By default, the system assigns each application a unique Linux user ID (the ID is used only

 by the system and is unknown to the application). The system sets permissions for all the files in

an application so that only the user ID assigned to that application can access them. Each process

has its own virtual machine (VM), so an application's code runs in isolation from other

appplications.

By default, every application runs in its own Linux process. Android starts the process when any

of the application's components need to be executed, then shuts down the process when it's no

longer needed or when the system must recover memory for other applications.

In this way, the Android system implements the principle of least privilege. That is, each

application, by default, has access only to the components that it requires to do its work and no

more. This creates a very secure environment in which an application cannot access parts of the

system for which it is not given permission.

However, there are ways for an application to share data with other applications and for an

application to access system services:

It's possible to arrange for two applications to share the same Linux user ID, in which case they

are able to access each other's files. To conserve system resources, applications with the same

user ID can also arrange to run in the same Linux process and share the same VM (the

applications must also be signed with the same certificate).

An application can request permission to access device data such as the user's contacts, SMS

messages, the mountable storage (SD card), camera, Bluetooth, and more. All application

 permissions must be granted by the user at install time.

This is the basics regarding how an Android application exists within the system.

The core framework components that define an application

i)  The manifest file in which you declare components and required device

features for your application.

ii)  Resources that are separate from the application code and allow your

application to gracefully optimize its behavior for a variety of device

configurations.

Page 30: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 30/34

 

Application Components

Application components are the essential building blocks of an Android application. Each

component is a different point through which the system can enter your application. Not all

components are actual entry points for the user and some depend on each other, but each one

exists as its own entity and plays a specific role. In other words, each one is a unique building block that helps define your application's overall behavior.

There are four different types of application components. Each type serves a distinct purpose and

has a distinct lifecycle that defines how the component is created and destroyed.

Here are the four types of application components:

Activities

An activity represents a single screen with a user interface. For example, an email application

might have one activity that shows a list of new emails, another activity to compose an email,and another activity for reading emails. Although the activities work together to form a cohesive

user experience in the email application, each one is independent of the others. As such, a

different application can start any one of these activities (if the email application allows it). For

example, a camera application can start the activity in the email application that composes new

mail, in order for the user to share a picture.

An activity is implemented as a subclass of Activity.

Services

A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a

service might play music in the background while the user is in a different application, or it

might fetch data over the network without blocking user interaction with an activity. Another

component, such as an activity, can start the service and let it run or bind to it in order to interact

with it.

A service is implemented as a subclass of Service.

Content providers

A content provider manages a shared set of application data. You can store the data in the file

system, a SQLite database, on the web, or any other persistent storage location your application

can access. Through the content provider, other applications can query or even modify the data

(if the content provider allows it). For example, the Android system provides a content provider

that manages the user's contact information. As such, any application with the proper

 permissions can query part of the content provider (such as ContactsContract.Data) to read and

write information about a particular person.

Page 31: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 31/34

Page 32: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 32/34

 

Because the system runs each application in a separate process with file permissions that restrict

access to other applications, your application cannot directly activate a component from another

application. The Android system, however, can. So, to activate a component in another

application, you must deliver a message to the system that specifies your intent to start a

 particular component. The system then activates the component for you.

Activating Components

Three of the four component types — activities, services, and broadcast receivers — are activated

 by an asynchronous message called an intent. Intents bind individual components to each other at

runtime (you can think of them as the messengers that request an action from other components),

whether the component belongs to your application or another.

An intent  is created with an Intent object, which defines a message to activate either a specific

component or a specific type of component — an intent can be either explicit or implicit,

respectively.

For activities and services, an intent defines the action to perform (for example, to "view" or

"send" something) and may specify the URI of the data to act on (among other things that the

component being started might need to know). For example, an intent might convey a request for

an activity to show an image or to open a web page. In some cases, you can start an activity to

receive a result, in which case, the activity also returns the result in an Intent (for example, you

can issue an intent to let the user pick a personal contact and have it returned to you — the return

intent includes a URI pointing to the chosen contact).

For broadcast receivers, the intent simply defines the announcement being broadcast (for

example, a broadcast to indicate the device battery is low includes only a known action string

that indicates "battery is low").

The other component type, content provider, is not activated by intents. Rather, it is activated

when targeted by a request from a ContentResolver. The content resolver handles all direct

transactions with the content provider so that the component that's performing transactions withthe provider doesn't need to and instead calls methods on the ContentResolver object. This leaves

a layer of abstraction between the content provider and the component requesting information

(for security).

Page 33: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 33/34

 

There are separate methods for activating each type of component:

i)  You can start an activity (or give it something new to do) by passing an Intent to

 startActivity() or startActivityForResult() (when you want the activity to return a

result).

ii)  You can start a service (or give new instructions to an ongoing service) by passing anIntent to startService(). Or you can bind to the service by passing an Intent to

bindService().

iii)  You can initiate a broadcast by passing an Intent to methods like sendBroadcast(),

 sendOrderedBroadcast(), or  sendStickyBroadcast().

iv)  You can perform a query to a content provider by calling query() on a

ContentResolver .

The Manifest File

Before the Android system can start an application component, the system must know that the

component exists by reading the application's AndroidManifest.xml file (the "manifest" file).

Your application must declare all its components in this file, which must be at the root of the

application project directory.

The manifest does a number of things in addition to declaring the application's components, such

as:

i)  Identify any user permissions the application requires, such as Internet access or read-

access to the user's contacts.

ii)  Declare the minimum API Level required by the application, based on which APIs

the application uses.

iii)  Declare hardware and software features used or required by the application, such as a

camera, bluetooth services, or a multitouch screen.

iv)  API libraries the application needs to be linked against (other than the Android

framework APIs), such as the Google Maps library.

Page 34: Demo Project Example

8/11/2019 Demo Project Example

http://slidepdf.com/reader/full/demo-project-example 34/34

 

2.3: Basic Implementation of the Alarm System

Currently, the future personal computing environment is expected to be led by virtualization-

 based cloud computing and smartphone-based mobile computing. This development of cloud

computing is helping in realizing SoD(System on Demand).SoD integrates virtual computing

environments with ubiquitous devices, such as an android phone, which we are using here. Also,more and more dependence on mobile devices is demanding the creation of various virtual

application based computing environments. Here, we create such an environment, synching it

with an android phone, to sense breaches and errors in industries that apply potentially dangerous

machinery. We are trying to achieve an application that would sense, transmit through a remote

connection, and alert a person using the prescribed android phone, in the case of a breach/error in

a given set of machinery.

Industry