Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1) Java(jdk1.5 or higher)
2) Normal windows os.
Hardware Requirements:-
Introduction:-
The mobile sets are now a days used most widely and very commonly. The SMS can be send to
any mobile user of any service provider with no or a minimum charge. This system is designed
using a GSM modem. The GSM modem is configured as a receiver which send the SMS to a
computer after receiving it completely. The SMS sent by the user is written in a particular
format. The computer receive the message and decode it and identify the task to be done.
Accordingly The computer send requset to the sms gateway insisting it to send messgaes to set of
user which satisfies a given condition. In this way the devices connected to the controller is
operated through an SMS.
1. This is cheaper and the SMS can be retained in the network even though the network is busy
for some time.
2. The SMS can be written through internet with out any cost.
The present scenario of technological advancement and research is stepping forward towards the
high speed and long distance data communication. The Mobile and cellular technology is one of
the reliable and advanced media for the data communication. The information technology makes
mobile communication more popular and economical. The science and technology is moving
with fast pace towards long distance communication and data transmission. The advancement in
long distance communication essentially can create a global village. This project is conceptually
based on long distance data communication and control. In the present scenario the application
of mobiles are very much common, almost every one is using a mobile for their day to day
affairs. The mobile networks are covering globally. The idea to use the mobile as a remote
control device is definitely a innovative and widely accepted concept. The mobile set as a remote
control can cover wide area compare to any other remote control devices. The IR remote
controller and RF remote controllers have its limitation on its range where as the mobile based
remote controllers can have a global range using wireless cellular network. In this project an
attempt is made to //control the electrical appliances globally by using the cellular network//. The
SMS technique is inexpensive and more reliable as the data transfer is in text based. In most of
the network the SMS facility is inexpensive or free. This concept of control system is very much
use full for industrial and consumer application. This type of applications can be used in
industries for controlling devices also the user can get field information and data through GSM
modem in the format of SMS etc. // The SMS based appliance controller is conceptual step
towards realization of Global village.//
Since the introduction of the GSM networks in 1992, SMS has been a service with an increasing
interest. SMS is actually not designed for the success it is having today. The marketing guys
within the standardization group could not see any use of a service, requiring that the user should
press the same key several times to write a character. The only reason for SMS became part of
the standard, was the techical guys wanting it for service messages and testing.
Today, SMS is an extensively used service and almost everyone is able to use it. This has lead to
an increasing number of applications using SMS as the interface to the user. This project
contains an SMS framework, written in Java. The framework is designed for robustness in order
to serve as a gateway between users with their mobile phone, and the application. The
implemented application is an SMS-to-OSC gateway, sending all incomming SMS' to an sms
gateway provider capable host.
Short Message System (SMS) is a part of the Global System for Mobile Communications (GSM)
specification. GSM is initially specified by European Telecommunications Standards Institute
(ETSI - http://www.etsi.org). The current specification is controlled by 3rd Generation
Partnership Project (3GPP - http://www.3gpp.org), from where the specification can be
downloaded. Note, it is huge!
In the first phase of the GSM networks, SMS reception was mandatory for a mobile phone
(called Mobile Station (MS) in the specification), but sending SMS was an optional feature.
From phase 2 of the GSM networks (1997), sending SMS became mandatory. The current
networks are all phase 2 or later.
SMS is a no-guaranties service. The operator of the GSM network does not give any guaranties
for delivery of SMSs. Because of this, SMS is a costless service for the operator, as messages
can be sent during idle periods of the network.
An SMS is just a single datapacket or Protocol Data Unit (PDU) in the network, but PDUs
cannot be sent without a connection. In order to send an MS originated SMS, the MS creates a
connection to the Base Transceiver Station (BTS), sends the PDU containing the SMS, and
finally closes the connection. Because an SMS is limited to one single PDU, it can only contain
160 characters. Modern MSs are able to send longer SMSs, called Extended Message System
(EMS), which just are several ordinary SMSs displayed as one on the MS.
Serial Communication in Java
In order to use SMS in a computer application, an interface between the computer and the GSM
network is needed. This interface is typically an MS connected to a serial port on the computer.
In this project the serial connection to an MS is the interface.
In Java, serial communication is specified in the package javax.comm, which is a part of the
extended specification (the javax). Because it is part of the extended specification, it it not part of
the reference Java implementation from Sun . Sun has only implemented javax.comm for
Microsoft Windows and Sun's Solaris/SPARC platform . Implementations for other platforms
exist, e.g. the RxTx project , which provides the javax.comm package for Linux, MacOS X, etc.
When an application is communicating through a serial interface, it can basicly do this in two
ways: It can poll the serial port for data (synchronously), and it can receive data events
(something like interrupts) when data is received (asynchronously). The javax.comm allows you
to do both. Synchronous communication is done by using the read methods on the InputStream
of the serial port. If there is no data, the method will wait (block) until data is available or a
timeout occurs. The timeout value can be set by the SerialPort.enableReceiveTimeout(int).
Asynchronously communication is done by implementing the SerialPortEventListener interface.
This requires implementation of the method serialEvent(SerialPortEvent event). It is possible to
specify which kind of serial events the application wants, by using the SerialPort.notifyOn*()
methods.
When using serial ports in Java, it is very important to close the port when the class has finish
using it. If the port is not closed correctly, no other application will be able to use it. In an
environment where the Java Virtual Machine (JVM) is running for a long time, e.g. in an
application server, forgetting to close the serial port might result in the need for a restart of the
JVM (and thereby the application server) in order to release the serial port.
The Java Communications 3.0 API is a Java extension that facilitates developing platform-
independent communications applications for technologies such as Smart Cards, embedded
systems, and point-of-sale devices, financial services devices, fax, modems, display terminals,
and robotic equipment.
The Java Communications API (also known as javax.comm) provides applications access to RS-
232 hardware (serial ports) and limited access to IEEE-1284 (parallel ports), SPP mode.
Implementations of the API are currently available for Solaris SPARC, Solaris x86, and Linux
x86. Each of Sun's available implementations works with the Sun Ray thin client product line,
and include portmapping extensions to allow an administer to specify the locations of ports as
well as their visibility, names, and in some cases annotated reference
API serial features:
Unlike classical drivers, which come with their own models of communication of
asynchronous events, the javax.comm API provides an event-style interface based
on the Java event model (java.awt.event package). Let's say we want to know if
there is any new data sitting on the input buffer. We can find that out in two ways --
by polling or listening . With polling, the processor checks the buffer periodically to
see if there is any new data in the buffer. With listening, the processor waits for an
event to occur in the form of new data in the input buffer. As soon as new data
arrives in the buffer, it sends a notification or event to the processor.
Among the various serial interfaces available, two of the most popular are the RS-
232C and RS-422 standards, which define the electrical signal levels and the
meaning of various signal lines. Low-speed serial interfaces typically clock data out
as a square wave, with clock coordination provided by start and stop bits.
RS-232 stands for Recommend Standard 232 ; the C simply refers to the latest
revision of the standard. The serial ports on most computers use a subset of the RS-
232C standard. The full RS-232C standard specifies a 25-pin "D" connector, of which
22 pins are used. Most of these pins are not needed for normal PC communications,
and indeed, most new PCs are equipped with male D-type connectors having only 9
pins.
FEATURES In DETAILS:-
Foundations
Platform independence
Swing is platform independent both in terms of its expression (Java) and its implementation
(non-native universal rendering of widgets).
Extensible
Swing is a highly partitioned architecture, which allows for the "plugging" of various custom
implementations of specified framework interfaces: Users can provide their own custom
implementation(s) of these components to override the default implementations. In general,
Swing users can extend the framework by extending existing (framework) classes and/or
providing alternative implementations of core components.
Customizable
Given the programmatic rendering model of the Swing framework, fine control over the details
of rendering of a component is possible in Swing. As a general pattern, the visual representation
of a Swing component is a composition of a standard set of elements, such as a "border", "inset",
decorations, etc. Typically, users will programmatically customize a standard Swing component
(such as a JTable) by assigning specific Borders, Colors, Backgrounds, opacities, etc., as the
properties of that component. The core component will then use these property (settings) to
determine the appropriate renderers to use in painting its various aspects. However, it is also
completely possible to create unique GUI controls with highly customized visual representation.
Configurable
Swing's heavy reliance on runtime mechanisms and indirect composition patterns allows it to
respond at runtime to fundamental changes in its settings. For example, a Swing-based
application can change its look and feel at runtime. Further, users can provide their own look and
feel implementation, which allows for uniform changes in the look and feel of existing Swing
applications without any programmatic change to the application code.
Lightweight UI
Swing's configurability is a result of a choice not to use the native host OS's GUI controls for
displaying itself. Swing "paints" its controls programmatically through the use of Java 2D APIs,
rather than calling into a native user interface toolkit. Thus, a Swing component does not have a
corresponding native OS GUI component, and is free to render itself in any way that is possible
with the underlying graphics APIs.
However, at its core every Swing component relies on an AWT container, since (Swing's)
JComponent extends (AWT's) Container. This allows Swing to plug into the host OS's GUI
management framework, including the crucial device/screen mappings and user interactions,
such as key presses or mouse movements. Swing simply "transposes" its own (OS agnostic)
semantics over the underlying (OS specific) components. So, for example, every Swing
component paints its rendition on the graphic device in response to a call to component.paint(),
which is defined in (AWT) Container. But unlike AWT components, which delegated the
painting to their OS-native "heavyweight" widget, Swing components are responsible for their
own rendering.
This transposition and decoupling is not merely visual, and extends to Swing's management and
application of its own OS-independent semantics for events fired within its component
containment hierarchies. Generally speaking, the Swing Architecture delegates the task of
mapping the various flavors of OS GUI semantics onto a simple, but generalized, pattern to the
AWT container. Building on that generalized platform, it establishes its own rich and complex
GUI semantics in the form of the JComponent model. A review of the source of Container java
and JComponent java classes is recommended for further insights into the nature of the interface
between Swing's lightweight components and AWT's heavyweight widgets.
The Swing library makes heavy use of the Model/View/Controller software design pattern[1],
which conceptually decouples the data being viewed from the user interface controls through
which it is viewed. Because of this, most Swing components have associated models (which are
specified in terms of Java interfaces), and the programmer can use various default
implementations or provide their own. The framework provides default implementations of
model interfaces for all of its concrete components.
Typically, Swing component model objects are responsible for providing a concise interface
defining events fired, and accessible properties for the (conceptual) data model for use by the
associated JComponent. Given that the overall MVC pattern is a loosely-coupled collaborative
object relationship pattern, the model provides the programmatic means for attaching event
listeners to the data model object. Typically, these events are model centric (ex: a "row inserted"
event in a table model) and are mapped by the JComponent specialization into a meaningful
event for the GUI component.
For example, the JTable has a model called TableModel that describes an interface for how a
table would access tabular data. A default implementation of this operates on a two-dimensional
array.
The view component of a Swing JComponent is the object used to graphically "represent" the
conceptual GUI control. A distinction of Swing, as a GUI framework, is in its reliance on
programmatically-rendered GUI controls (as opposed to the use of the native host OS's GUI
controls). Prior to Java 6 Update 10, this distinction was a source of complications when mixing
AWT controls, which use native controls, with Swing controls in a GUI (see Mixing AWT and
Swing components).
Finally, in terms of visual composition and management, Swing favors relative layouts (which
specify the positional relationships between components) as opposed to absolute layouts (which
specify the exact location and size of components). This bias towards "fluid"' visual ordering is
due to its origins in the applet operating environment that framed the design and development of
the original Java GUI toolkit. (Conceptually, this view of the layout management is quite similar
to that which informs the rendering of HTML content in browsers, and addresses the same set of
concerns that motivated the former.)
Relationship to AWT
Since early versions of Java, a portion of the Abstract Window Toolkit (AWT) has provided
platform-independent APIs for user interface components. In AWT, each component is rendered
and controlled by a native peer component specific to the underlying windowing system.
By contrast, Swing components are often described as lightweight because they do not require
allocation of native resources in the operating system's windowing toolkit. The AWT
components are referred to as heavyweight components.
Much of the Swing API is generally a complementary extension of the AWT rather than a direct
replacement. In fact, every Swing lightweight interface ultimately exists within an AWT
heavyweight component because all of the top-level components in Swing (JApplet, JDialog,
JFrame, and JWindow) extend an AWT top-level container. However, the use of both lightweight
and heavyweight components within the same window is generally discouraged due to Z-order
incompatibilities.
The core rendering functionality used by Swing to draw its lightweight components is provided
by Java 2D, another part of JFC.
Relationship to SWT
The Standard Widget Toolkit (SWT) is a competing toolkit originally developed by IBM and
now maintained by the Eclipse community. SWT's implementation has more in common with
the heavyweight components of AWT. This confers benefits such as more accurate fidelity with
the underlying native windowing toolkit, at the cost of an increased exposure to the native
platform in the programming model.
The advent of SWT has given rise to a great deal of division among Java desktop developers,
with many strongly favoring either SWT or Swing. Sun's development on Swing continues to
focus on platform look and feel (PLAF) fidelity with each platform's windowing toolkit in the
approaching Java SE 7 release (as of December 2006).
There has been significant debate and speculation about the performance of SWT versus Swing;
some hinted that SWT's heavy dependence on JNI would make it slower when the GUI
component and Java need to communicate data, but faster at rendering when the data model has
been loaded into the GUI, but this has not been confirmed either way A fairly thorough set of
benchmarks concluded that neither Swing nor SWT clearly outperformed the other in the general
case.
SWT serves the Windows platform very well but is considered by some to be less effective as a
technology for cross-platform development. By using the high-level features of each native
windowing toolkit, SWT returns to the issues seen in the mid 90's (with toolkits like zApp, Zinc,
XVT and IBM/Smalltalk) where toolkits attempted to mask differences in focus behaviour, event
triggering and graphical layout. Failure to match behavior on each platform can cause subtle but
difficult-to-resolve bugs that impact user interaction and the appearance of the GUI.
Debugging
Swing application debugging can be difficult because of the toolkit's visual nature. In contrast to
non-visual applications, GUI applications cannot be as easily debugged using step-by-step
debuggers.
The main reason is that Swing normally performs painting into an off-screen buffer (double
buffering) first and then copies the entire result to the screen. This is to not let the user observe
the painting process which would be perceived as flickering. This makes it difficult to observe
the impact of each separate graphical operation on the user interface using a general-purpose
Java debugger. To help with this problem, one can turn off double buffering, and have the
drawing operations visualized using the built-in DebugGraphics object .Also, a free and open
source GUI-based debugging application called Swing Explorer will be of help with drawing
problems: It will locate which component painted every single pixel in a window, where each
component was instantiated, displays the time line for each drawing operation, and will present a
"DOM-like" tree of all Components in the JVM along with visualization of where the selected
component painted. All operations are done through a side GUI which injects itself into the
application, thus making Swing debugging considerably more effective.
There are also some common problems related to the painting thread. Swing uses the AWT event
dispatching thread for painting components. In accordance with Swing standards, all components
must be created and accessed only from the AWT event dispatch thread. If the application
violates this rule, it may cause unpredictable behavior. The third-party, free and open source
pluggable Look and Feel called Substance can help here, as it refuses to handle any components
off of the Event Dispatch Thread, thus pinpointing violations to this rule.
If long-running operations are performed in the AWT event dispatch thread, repainting of the
Swing user interface temporarily becomes impossible causing screen freezes. Such operations
must be moved into a separate thread.
It is worth emphasizing that these problems are not in any way unique to Swing - most GUI
toolkits necessarily have similar problem spaces with threading and buffering.
FLOWCHARTS:-
3.4. BLOCK DIAGRAM
PC with Rf signal
JAVA GSM
Appln MODEM
signals
Radio Frequency
Signals