You are on page 1of 50

Wireless Cost Effective

Security System Using


GPRS/EDGE
Group Members
Rafay Hassan Niazi (303)
Nisar Hussain (140)
Syed Zain Abbas Jafri (106)
Farrukh Saleem (03)
Description

 It’sa Network Application based on


Client/Server Architecture for Remote
Monitoring with the aid of most
commonly used hand held device i.e.
Cell Phone.

 Mobile Application will interact with the


mobile camera and take snapshots at
user’s will. At the same time the
application will establish connection
with the Server using GPRS or EDGE
Description

 Thecurrent image uploaded to web


server and stored in database, now
can be viewed on any other
GPRS/EDGE enabled cell phone
running our Receiver Mobile
Application.
Mobile WEB SERVER GPRS
Camera ENABLED
with DEVICE
GPRS
Motivation

 The idea is to build an application


that would monitor any remote
location without the constraints of
the following.

ØWired system of Devices.
ØSpecified Region/Boundary.
ØHigher Cost of Implementation.

Solution

 Wireless
Device
 Cell Phone is the most commonly
used and easily available Wireless
Device.

 No Boundary limit
 Once uploaded to the Web Server ,
images/snapshots of the distant
location would be easily accessible
via Internet.
Solution

 CostEfficient Implementation
 Our Mobile Sender Application will
turn a simple mobile camera into
Surveillance Camera and upload the
current images with the aid of
GPRS/EDGE without requiring any
additional Hardware.
Solution

 Our project comprises of two mobile


applications run separately on two
cell phones and a Server
application runs on Web Server.

 Both Mobile applications connect
with Server application to perform
their respective functions.

Major Concepts Of The
Project
GPRS (General Packet
Radio Service)
Ø2.5G Cellular Communication (GSM).
ØPacket Oriented Mobile data service.
Øa best-effort packet switched
service.
ØData rates of 56-114 Kbit/s.
ØSupports WAP (Wireless Application
Protocol)
ØWAP enables access to Mobile Web.
ØGPRS data transfer is typically
charged per megabyte of traffic
GPRS (General Packet
Radio Service)
ØIt provides moderate speed data
transfer, by using unused 
time division multiple access
 (TDMA) channels in the GSM
system.
ØWhen TCP/IP is used, each phone
can have one or more IP addresses
 allocated.
ØTCP handles any packet loss (e.g.
due to a radio noise induced
GPRS (General Packet
Radio Service)
ØThe upload and download speeds in
GPRS depend on a number of
factors such as:
üthe number of BTS TDMA time
slots assigned by the operator.
üthe maximum capability of the
mobile device expressed as a 
GPRS multislot class
üthe channel encoding used.
EDGE (Enhanced Data
rates for GSM Evolution)
ØPart of ITU’s 3G definition
ØPacket Oriented
ØMax Data rate of 474 Kbit/s
ØEDGE requires no hardware or
software changes to be made in 
GSM core networks.
ØEDGE-delivered data services create
a broadband internet-like
experience for the mobile phone
user.
EDGE (Enhanced Data
rates for GSM Evolution)
ØIt is an upgrade that provides more
than three-fold increase in both the
capacity and performance of
GSM/GPRS networks.
ØIn addition to 
Gaussian minimum-shift keying
 (GMSK), EDGE uses 
higher-order PSK/8 phase shift keying
 (8PSK).

MIDP (Mobile Information
Device Profile)
ØA specification published for the use
of Java on embedded devices such
as mobile phones and PDAs
ØMIDP is part of the 
Java Platform, Micro Edition (Java
ME) framework
ØThere are several different ways to
create MIDP applications.
Code can be written in a plain 
text editor.
MIDlet

ØAn application that conforms to the


MIDP standard.
ØTypically implemented on a Java-
enabled cell phone or other 
embedded device or emulator
ØUnlike a Java applet, a MIDlet is
limited to use of the LCDUI
ØThe main class needs to be a
subclass of
javax.microedition.midlet.MIDlet
Mobile Media API
(MMAPI)
ØEmbedding multimedia capabilities
in a MIDlet.
ØJava Specification Requests (JSR) 135
ØPlay different formats of audio and
video files from the network, a
record store, or a Java Archive (JAR)
file.
ØCapture audio and video and take
snapshots.
ØDifferent device manufactures
Mobile Media API
(MMAPI)
ØAllow you to access media over HTTP
and play the WAV file format for
audio and MP3 for video.
ØAll devices can be queried to
discover their capabilities.

Servlet

ØA servlet is a Java programming


language class used to extend the
capabilities of servers.
ØHost applications accessed via a
request-response programming
model.
ØJava Servlet technology defines
HTTP-specific servlet classes for
applications hosted by Web
servers.
Servlet

 The Basic Servlet Architecture or


Life Cycle

Servlet Container

ØA specialized web server that


supports servlet execution.
ØThe ability to automatically translate
specific URLs into servlet requests.
ØServlets are registered with a servlet
container.
ØAlso referred to as web
containers or web engines.
ØOur Server Application uses Tomcat
as servlet container.

Hyper Text Transfer
Protocol
Overview

ØCore of our project.


ØAn application-level TCP/IP based
protocol.
ØDeliver virtually all files and other
data, collectively called resources,
on the World Wide Web.
ØA browser works as an HTTP client.
ØSends requests to an HTTP server
which is called Web server.
ØPort for HTTP servers to listen on is
Overview

ØHTTP is connectionless.
ØHTTP is media independent.
ØHTTP is stateless.

Message Format

ØHTTP uses the client-server model.


ØAn HTTP client opens a connection
and sends a request message to an
HTTP server.
ØThe server then returns a response
message, usually containing the
resource.
ØThe format of the request and
response messages is similar.
ØStructure of Message:
Message Format

Zero or more header lines CRLF


A blank line i.e.. a CRLF
An optional message body like file,
query data or query output.

Methods()

ØThe GET Method.


üClient application.
üThe GET method means retrieve
information.
üIdentified by the Request-URI.
üRequest-URI refers to a data-producing
process.
üProduced data shall be returned as the
entity in the response.
üThe GET method can also be used to
Methods()

üEntire form submission can be


encapsulated in one URL.
üYou can access the CGI or Servlet
program with a query.
üFully includes it in the URL.
üExample:
http://myhost.com/mypath/myscript.cg

i?name1=value1&name2=value2.
Methods()
ØThe POST Method
Client Application.
A POST request is used to send data to
the server to be processed by
Servlet.
A block of data sent with the request,
in the message body.
Extra headers like Content-Type: and
Content-Length:
The request URI is not a resource to
retrieve.
Methods()

The HTTP response is normally


program output, not a static file.
Query length can be unlimited (unlike
in GET)
Can send entire files using post.
Form data is attached to the end of
the POST request (as opposed to the
URL).
Not as quick and easy as using GET,
but more versatile.
Methods()

ØThe doGet Method


Server application.
Performs the HTTP GET operation.
Overriding this method to support the
GET operation also automatically
supports the HEAD operation.
Set entity headers in the response.
Access the writer or output stream.
Write any response data.

Methods()

Include content type, and encoding.


Headers before the response data.
May include Data retrieval from
database.
Parameters:
req - HttpServletRequest that
encapsulates the request to the servlet.
resp - HttpServletResponse that
encapsulates the response from the
servlet.
Methods()

ØThe doPost method


Server application.
Performs the HTTP POST operation.
Read any data from the request (for
example, form parameters).
May include storing data in Database.
Set entity headers in the response.
Access the writer or output stream.
Write any response.

Methods()

Parameters:
req - HttpServletRequest that
encapsulates the request to the servlet.
resp - HttpServletResponse that
encapsulates the response from the
servlet.

Phases of Project
Modules


ØSender Client
Ø
ØWeb Server
Ø
ØReceiver Client


Sender Client

ØA Mobile client software/application.


ØCoding in J2ME (refer as MIDlet)
ØWorks in two phases:
Capture Image
Transfer Image
ØBoth phases take place concurrently.
ØNothing in common when comes to
the implementation in form of
code.

Sender Client
Sub Modules

 Web Server

ØGet Image
 Code to receive the image in form
of byte stream from Mobile Client.
Ø
ØDisplay Image
 Code to display the image on Mobile
webpage in proper format.
Sub Modules

 Viewer Client
Ø
ØUtilizing simple Web Browser (e.g.
Opera Mini) in Cell Phone for
Viewing current image on Mobile
Webpage.
Ø
ØViewer Client Application (if time
permits)
 Proper application on Viewer Client
for downloading image from Web
Application Flow
Monitor
Client
ImageCapture
() Web Server

ImageUpload ReceiveImage
() () Viewer
Client
Browser
DisplayImag
Establish connection e ()
DownloadImage
()

Establish connection DisplayImag


e ()
Project Progress
Work Done


 Monitor Client

üImageCapture();
ü
üImageUpload();
ImageCapture();
 /* the first step in taking pictures (officially called video capture) is
obtaining a Player(to control media) from the Manager. Manager is the
access point for obtaining system dependent resources*/
private void ImageCapture() {

try {

 mPlayer=Manager.createPlayer("capture://video"); /*image
captured from camera using default image size*/

 mPlayer.realize(); /*construct portion of the player w/o acquiring


exclusive resources(examine media data & may take some time to
complete)*/

 mVideoControl=(VideoControl)mPlayer.getControl(“VideoControl");
/*video is displayed on the screen as an Item(superclass of component
that can be added to a form). VideoControl class makes this possible*/

 Form form = new Form("Camera");


 Item item =
(Item)mVideoControl.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE,
ImageCapture();
 form.append(item);
form.addCommand(mBackCommand);

form.setCommandListener(this);

mDisplay.setCurrent(form);

mPlayer.start();

 }

catch (IOException ioe) { handleException(ioe); } /*IO exception of


some sort occur*/
catch (MediaException me) { handleException(me); } /*indicate

unexpected error condition in a method*/


 while(true) {
try {

 byte[] raw = mVideoControl.getSnapshot(null); /*get the


snapshot of the displayed content and return as a byte array*/
 Image image = Image.createImage(raw, 0, raw.length);
/*creates immutable image decoded from the data stored in the
byte array*/
ImageCapture();
 catch (MediaException me) { handleException(me); }
 }
 }

 private void handleException(Exception e) {


 Alert a= new Alert("Exception", e.toString(), null,
null); /*to inform the user about errors and other
exception condition*/
 a.setTimeout(Alert.FOREVER); /*set the time for
which the Alert is to be shown*/
 mDisplay.setCurrent(a, mForm);
 }


Work Left

 Monitor
Client
! Removal of Runtime errors

 Web Server
! ReceiveImage();
! DisplayImage();

 Viewer Client (if time permits)
! DownloadImage();
! DisplayImage();
Tools & Resources

 Tools
 J2ME (NetBeans IDE 6.5.1)
 Tomcat

 Resources
 java.sun.com/javame
 JAVA2 by Ivor Horton
 J2ME Tutorials
End Of Presentation

You might also like