Professional Documents
Culture Documents
CHAPTER 1
INTRODUCTION
1.1 OBJECTIVE
This project used news reporting agency for administer news site in real time. For
instance, let us assume an event is taking place. A reporter arriving at the site of the event can
record the news of the current scenario from the various sources. He can take snaps and videos
and upload them right at the moment to the web-server making it available to the world in no
time. Mobile Blogging System is implement in real-time news reporting system application. The
main purpose of this application is to enable secure content administration using any smart
mobile device (Java enabled and having GPRS connectivity), which helps “Any Where Any
Time” administration possible. This application provides interface for the user to securely add in
various useful data, which can be interactively displayed on the web in real time. Both textual as
well as multimedia contents (pictures and video) can be managed. There are options to
edit/delete and thus provide various content management related features. The system structure
of the project is divided into Client Side and Server Side. In Client Side, MIDP application is
used which resides on the mobile device. Additionally this add optional package Mobile Media
API to handle multimedia contents. In Server Side, J2EE technology is used.
2
CHAPTER 2
SYSTEM ANALYSIS
A Content Management System works by storing pictures and text into a database.
When a webpage is requested, the CMS system accesses the database and renders the webpage.
Because the data is separated from the code, changes to the data can be made using a web
interface that requires no knowledge of HTML or ftp.
The disadvantage of dynamic content management systems is that they are resource
hungry. The servers they run on need to be maintained by technicians, and content management
requires more memory, CPU power and software maintenance. Small setting changes in the
server can cause the entire CMS to fail and as a consequence the website will not be viewable or
return errors.
In the present paper we put forth a design for Mobile Blogging System architecture
to operate on a mobile device. It is a wireless application aimed at helping the general
administration of cyber contents while being on the move. It is a wireless cyber content
management software running on a java enabled mobile device having GPRS connectivity. The
main purpose of this application is to enable secure cyber content administration using any smart
mobile device (Java enabled and having GPRS connectivity), which helps “Any Where Any
Time” administration possible.
This application provides interface for the user to securely add in various useful data,
which can be interactively displayed on the web in real-time. Both textual as well as multimedia
contents can be managed.
3
Feasibility study is the test of a system proposal according to its workability, impact
on the organization, ability to meet user needs, and effective use of recourses. It focuses on the
evaluation of existing system and procedures analysis of alternative candidate system cost
estimates. Feasibility analysis was done to determine whether the system would be feasible.
Feasibility study helps the analyst to decide whether or not to proceed, amend,
postpone or cancel the project, particularly important when the project is large, complex and
costly. Once the analysis of the user requirement is complement, the system has to check for the
compatibility and feasibility of the software package that is aimed at. An important outcome of
the preliminary investigation is the determination that the system requested is feasible.
The technology used can be developed with the current equipments and has the
technical capacity to hold the data required by the new system.
Technical feasibility on the existing system and to what extend it can support the
proposed addition. We can add new modules easily without affecting the Core Program. Most of
parts are running in the server using the concept of stored procedures. A large part of
determining resources has to do with assessing technical feasibility. The analyst must find out
whether current technical resources can be upgraded or added to in a manner that fulfills the
request under consideration. However, sometimes "add-ons" to existing systems are costly and
not worthwhile, simply because they must meet needs inefficiently. If existing systems cannot
4
be added onto, then the next question becomes whether there is technology in existence that
meets the specifications.
This proposed system can easily implemented, as this is based on JSP coding
(JAVA) & HTML .The database created is with MySQL server which is more secure and easy
to handle. The resources that are required to implement/install these are available. The personal
of the organization already has enough exposure to computers. So the project is operationally
feasible.
Suppose for a moment that technical and economic resources are both judged
adequate. The systems analyst must still consider the operational feasibility of the requested
project. Operational feasibility is dependent on human resources available for the project and
involves projecting whether the system will operate and be used once it is installed. If users are
virtually wed to the present system, see no problems with it, and generally are not involved in
requesting a new system, resistance to implementing the new system will be strong. Chances for
it ever becoming operational are low.
Economic analysis is the most frequently used method for evaluating the
effectiveness of a new system. More commonly known cost/benefit analysis, the procedure is to
determine the benefits and savings that are expected from a candidate system and compare them
with costs. If benefits outweigh costs, then the decision is made to design and implement the
system. An entrepreneur must accurately weigh the cost versus benefits before taking an action.
This system is more economically feasible which assess the brain capacity with quick & online
test. So it is economically a good project.
5
CHAPTER 3
SYSTEM SPECIFICATION
CHAPTER 4
SOFTWARE DESCRIPTION
4.1.1 J2ME
Java 2 Platform, Micro Edition (J2ME) is part of the Java 2 platform. While Java 2
Standard Edition (J2SE) targets desktop systems, and Java 2 Enterprise Edition (J2EE) targets
the server backend applications, J2ME is a collection of APIs focusing on consumer and
embedded devices, ranging from TV set-top boxes, telematics systems, residential gateways, to
mobile phones and PDAs. Within each edition of the Java 2 platform, there are different Java
Virtual Machine (JVM) implementations that are optimized for the type of systems they are
targeted at. For example, the K Virtual Machine (KVM) is a JVM optimized for resource
constrained devices, such as mobile phones and PDAs.
7
Contrary to the web browser model, which requires continuous connectivity and
offers a limited user interface and security experiences, J2ME allows applications to be
dynamically downloaded to a mobile device in a secure fashion. J2ME applications can be
posted on a Web server, allowing end users to initiate the download of an application they select
through a micro browser or other application locator interface.
loaded
active
8
paused
destroyed
startApp()
We will start our application by the startApp(). Now the MIDlet will be in the active
stage until we call the pauseApp() or destroyApp(). It called only once when the MIDlet is
loaded at the first time to run.
pauseApp()
This is will stop the application and release the resources that are needed for the
program.
destroyApp()
This takes the Boolean as parameter. If it is false then the MIDlet is allowed to refuse
its termination by throwing a MIdletStateChangeException.
J2ME Tools
J2ME is used to define small, resource constraint devices. Its not a new language but
developed on existing one for handheld and embedded devices.Java ME (J2ME) has positioned
itself as the best solution for an extremely wide range of small devices. The huge and fast
growing base of java developers worldwide provides a ready resource for creating Java ME
(J2ME) apps. Java ME (J2ME) promises developers and companies portability across the widest
range of devices imaginable. J2ME combines a resource constrained JVM and a set of Java APIs
for developing applications for mobile devices.
The key components of J2ME is
• Configurations
• Profiles
Configurations
9
The configurations define the basic J2ME environment. The key point is each
connection is geared up to specific family of devices with similar capabilities. The two
configurations we have is
CLDC
This is limited for small devices like Mobiles, PDA, and Pagers. As a group, these
devices have important power, memory, and network bandwidth restrictions that directly affect
the kind of Java applications that they can support specifies the Java environment for mobile
phone, pager and wireless devices
CDC
The CDC is targeted to the devices that are less restricted like Set Top Boxes
(devices that are designed for n/w based computing process) ,Car Navigation System. The CDC
is the superset of CLDC it includes all the classes of CLDC. And also the CDC includes many
more classes of core J2se and this makes the java programmers more comfortable to use .here is
one biggest difference between CDC and CLDC. The CDC VM supports all the advanced
features of J2SE VM with low level debugging and native program interface. Sun has released a
new JVM called Compact VM (CVM) for this purpose. This is more portable and efficient than
standard VM.
Profile
A profile extends Configuration it adds some domain specific classes to core set of
classes. Profiles are the double edged sword of J2ME: While they provide important and
necessary functionality, not every device will support every profile.
• A Personal Digital Assistant Profile (PDAP) that extends the CLDC to take advantage of
the extended capabilities of PDAs when compared to the simpler devices targeted by the
MIDP.
• A Foundation Profile that adds additional J2SE classes to the CDC but no user interface
classes. It acts as a foundation for building other profiles.
• A Personal Profile that redefines Personal Java as a J2ME profile. The Personal Profile
extends the Foundation Profile.
• An RMI Profile that adds RMI support to the CDC.
Model
View
Renders the model into a form suitable for interaction, typically a user interface
element. Multiple views can exist for a single model for different purposes.
Controller
11
Processes and responds to events, typically user actions, and may invoke changes on
the model.
• You can distribute development effort to some extent, so that implementation changes in
one part of the Web application do not require changes to another. The developers
responsible for writing the business logic can work independently of the developers
responsible for the flow of control, and Web-page designers can work independently of
the developers.
• You can more easily prototype your work. You might do as follows, for example:
12
• You can more easily migrate legacy programs, because the view is separate from the
model and the control and can be tailored to platform and user category.
• You can maintain an environment that comprises different technologies across different
locations.
• The MVC design has an organizational structure that better supports scalability (building
bigger applications) and ease of modification and maintenance (due to the cleaner
separation of tasks).
4.1.3 Servlets
The Java Servlet API allows a software developer to add dynamic content to a Web
server using the Java platform. The generated content is commonly HTML, but may be other
data such as XML. Servlets are the Java counterpart to non-Java dynamic Web content
technologies such as PHP, CGI and ASP.NET. Servlets can maintain state across many server
transactions by using HTTP cookies, session variables or URL rewriting.
The Servlet API, contained in the Java package hierarchy javax.servlet, defines the
expected interactions of a Web container and a servlet. A Web container is essentially the
component of a Web server that interacts with the servlets. The Web container is responsible for
managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the
URL requester has the correct access rights.
A Servlet is an object that receives a request and generates a response based on that
request. The basic servlet package defines Java objects to represent servlet requests and
responses, as well as objects to reflect the servlet's configuration parameters and execution
13
Servlets are Java technology's answer to CGI programming. They are programs that
run on a Web server and build Web pages. Building Web pages on the fly is useful (and
commonly done) for a number of reasons:
• The Web page is based on data submitted by the user. For example the results pages from
search engines are generated this way, and programs that process orders for e-commerce
sites do this as well.
• The data changes frequently. For example, a weather-report or news headlines page
might build the page dynamically, perhaps returning a previously built page if it is still up
to date.
• The Web page uses information from corporate databases or other such sources. For
example, you would use this for making a Web page at an on-line store that lists current
prices and number of items in stock.
Some Web servers, such as Sun's Java Web Server (JWS), W3C's Jigsaw and Gefion
Software's LiteWebServer (LWS) are implemented in Java and have a built-in servlet engine.
Other Web servers, such as Netscape's Enterprise Server, Microsoft's Internet Information Server
(IIS) and the Apache Group's Apache, require a servlet engine add-on module. The add-on
14
intercepts all requests for servlets, executes them and returns the response through the Web
server to the client. Examples of servlet engine add-ons are Gefion Software's WAICoolRunner,
IBM's WebSphere, Live Software's JRun and New Atlanta's ServletExec.
All Servlet API classes and a simple servlet-enabled Web server are combined into
the Java Servlet Development Kit (JSDK), available for download at Sun's official Servlet site
.To get started with servlets I recommend that you download the JSDK and play around with the
sample servlets.
With CGI you read environment variables and stdin to get information about the
request, but the names of the environment variables may vary between implementations and
some are not provided by all Web servers. The HttpServletRequest object provides the same
information as the CGI environment variables, plus more, in a standardized way. It also provides
methods for extracting HTTP parameters from the query string or the request body depending on
the type of request (GET or POST). As a servlet developer you access parameters the same way
for both types of requests. Other methods give you access to all request headers and help you
parse date and cookie headers.
Instead of writing the response to stdout as you do with CGI; you get an
OutputStream or a PrintWriter from the HttpServletResponse. The OuputStream is intended for
binary data, such as a GIF or JPEG image, and the PrintWriter for text output. You can also set
all response headers and the status code, without having to rely on special Web server CGI
configurations such as Non Parsed Headers (NPH). This makes your servlet easier to install.
There is only one ServletContext in every application. This object can be used by all
the servlets to obtain application level information or container details. Every servlet, on the
other hand, gets its own ServletConfig object. This object provides initialization parameters for a
servlet. A developer can obtain the reference to ServletContext using either the ServletConfig
object or ServletRequest object.
All servlets belong to one servlet context. In implementations of the 1.0 and 2.0
versions of the Servlet API all servlets on one host belongs to the same context, but with the 2.1
version of the API the context becomes more powerful and can be seen as the humble beginnings
of an Application concept. Future versions of the API will make this even more pronounced.
16
Many servlet engines implementing the Servlet 2.1 API let you group a set of
servlets into one context and support more than one context on the same host. The
ServletContext in the 2.1 API is responsible for the state of its servlets and knows about
resources and attributes available to the servlets in the context. Here we will only look at how
ServletContext attributes can be used to share information among a group of servlets.
There are three ServletContext methods dealing with context attributes: getAttribute,
setAttribute and removeAttribute. In addition the servlet engine may provide ways to configure a
servlet context with initial attribute values. This serves as a welcome addition to the servlet
initialization arguments for configuration information used by a group of servlets, for instance
the database identifier we talked about above, a style sheet URL for an application, the name of a
mail server, etc.
4.1.4 JSP
The JSP syntax adds additional XML-like tags, called JSP actions, to be used to
invoke built-in functionality. Additionally, the technology allows for the creation of JSP tag
libraries that act as extensions to the standard HTML or XML tags. Tag libraries provide a
platform independent way of extending the capabilities of a Web server. JSPs are compiled into
Java Servlets by a JSP compiler. A JSP compiler may generate a servlet in Java code that is then
compiled by the Java compiler, or it may generate byte code for the servlet directly. JSPs can
also be interpreted on-the-fly reducing the time taken to reload changes.
17
Java Server Pages (JSP) technology provides a simplified, fast way to create dynamic
web content. JSP technology enables rapid development of web-based applications that are
server- and platform-independent.
• Active Server Pages (ASP) is a similar technology from Microsoft. The advantages of
JSP are twofold. First, the dynamic part is written in Java, not Visual Basic or other MS-
specific language, so it is more powerful and easier to use. Second, it is portable to other
operating systems and non-Microsoft Web servers.
• Pure Servlets. JSP doesn't give you anything that you couldn't in principle do with a
servlet. But it is more convenient to write (and to modify!) regular HTML than to have a
zillion println statements that generate the HTML. Plus, by separating the look from the
content you can put different people on different tasks: your Web page design experts can
18
build the HTML, leaving places for your servlet programmers to insert the dynamic
content.
• JavaScript. JavaScript can generate HTML dynamically on the client. This is a useful
capability, but only handles situations where the dynamic information is based on the
client's environment. With the exception of cookies, HTTP and form submission data is
not available to JavaScript. And, since it runs on the client, JavaScript can't access server-
side resources like databases, catalogs, pricing information, and the like.
• Static HTML. Regular HTML, of course, cannot contain dynamic information. JSP is so
easy and convenient that it is quite feasible to augment HTML pages that only benefit
marginally by the insertion of small amounts of dynamic data. Previously, the cost of
using dynamic data would preclude its use in all but the most valuable instances.
4.1.5 JDBC
In the three-tier model, commands are sent to a "middle tier" of services, which then
sends the commands to the data source. The data source processes the commands and sends the
results back to the middle tier, which then sends them to the user. MIS directors find the three-
tier model very attractive because the middle tier makes it possible to maintain control over
access and the kinds of updates that can be made to corporate data. Another advantage is that it
simplifies the deployment of applications. Finally, in many cases, the three-tier architecture can
provide performance advantages.
19
4.2.1 My-SQL
MySQL software is Open Source. Open Source means that it is possible for anyone
to use and modify. Anybody can download the MySQL software from the Internet and use, can
study the source code and change it to fit their needs. The MySQL software is Dual Licensed.
20
You can choose to use the MySQL software as an Open Source/Free Software product under the
terms of the GNU General Public License or can purchase a standard commercial license.
MySQL Server was originally developed to handle large databases and has been
successfully used in highly demanding production environments for several years. Though under
constant development, MySQL Server today offers a useful set of functions. Its connectivity
make MySQL Server suited for accessing databases on the Internet.
Tomcat is an open source web server developed by Apache Group. Apache Tomcat
is the Servlet container that is used in the official Reference Implementation for the Java Servlet
and JavaServer Pages technologies.
Apache Tomcat (or Jakarta Tomcat or simply Tomcat) is an open source servlet
container developed by the Apache Software Foundation (ASF). Tomcat implements the Java
Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a
"pure Java" HTTP web server environment for Java code to run. Tomcat should not be confused
with the Apache web server, which is a C implementation of an HTTP web server; these two
web servers are not bundled together. Apache Tomcat includes tools for configuration and
management, but can also be configured by editing XML configuration files. The important
components of the product are listed below.
Catalina: It is the main container for the servlet, which implements Sun Microsystem’s
specification for the servlet and the JSP
Coyote: Coyote is the Tomcat’s HTTP connector that supports the HTTP 1.1 protocol. It has a
support for the web server or application container.
21
Jasper: This is the main JSP Engine for the Tomcat. It is the implementation of the Sun
Microsystems java Server Pages and the specification. Jasper at the runtime is able to
automatically detect the JSP file changes and then it recompiles them.
• /bin - Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are
functional duplicates of the *.bat files (for Windows systems). Since the Win32
command-line lacks certain functionality, there are some additional files in here.
• /conf - Configuration files and related DTDs. The most important file in here is
server.xml. It is the main configuration file for the container.
CHAPTER 5
PROJECT DESCRIPTION
A Content Management System works by storing pictures and text into a database.
When a webpage is requested, the CMS system accesses the database and renders the webpage.
Because the data is separated from the code, changes to the data can be made using a web
interface that requires no knowledge of HTML or ftp.
The disadvantage of dynamic content management systems is that they are resource
hungry. The servers they run on need to be maintained by technicians, and content management
requires more memory, CPU power and software maintenance. Small setting changes in the
22
server can cause the entire CMS to fail and as a consequence the website will not be viewable or
return errors.
The whole world is going mobile. Phones, computers and media devices now fit in
our pockets and can connect us to a variety of information sources and enable communication
nearly everywhere we go. In fact mobile phones can comfortably be referred to as Africa’s
personal computers. There is considerable interest in exploiting the appeal and abundance of
mobile technology for its development use.
A local device is similar to a key fob with a button that unlocks a car, a 900 MHz
cordless phone, a radio control toy, or a Bluetooth network. All of these devices operate over
short distances, typically just a few meters. Wide area wireless devices operate effectively over a
much greater area. A pager or mobile phone is a good example; you can talk on your mobile
phone to any other phone on the planet. These devices' greater range relies on a more elaborate
land-based network. A mobile phone doesn't have that much more radio power than a radio
control toy. What it does have is a network of carefully placed radio antennas (cell towers); the
phone can continue to operate as long as it is within range of at least one tower.
The mobile phone device receives service from a wireless carrier, a company that
operates the land-based network. While a number of industry consortia and standard bodies, such
as the International Telecommunication Union, are trying to define or foster the development of
standards for the wireless world, today's wireless world is still fragmented and complex. For
example in Kenya there are two mobile service providers on which a mobile phone might run on;
either the Safaricom network or the Celtel network. In contrast in the U.S.mobile phones run on
AT&T, Spring and Verizon Wireless.
23
Web Blogging is a technique that makes it easy for people to publish their thoughts
on the World Wide Web. Since the dawn of the Web, it has always been possible to publish
content, but Blogging simplifies the process and adds important features. Anyone with a web
browser can publish a Blog, without having the knowledge of HTML or any of the other
technologies usually associated with web publishing: FTP, Telnet, Javascript, and Java Servlets.
Blogging is still in a volcanic stage technologically; the landscape is covered with competing and
rapidly evolving packages and protocols.
Micro Blogging is a form of Blogging that allows users to write brief text updates
(usually less than 200 characters) and publish them, either to be viewed by anyone or by a
restricted group which can be chosen by the user. These messages can be submitted by a variety
of means, including text messaging, instant messaging, email, MP3 or the web. Micro Blogging
is similar to mobile Blogging but it deals with text messages exclusively. The most popular
service that uses this technology is known as Twitter and it was founded in 2006.
The Mobile Blogging system works with all mobile systems that have internet
connection and that have the java application installed. It also provides for remote website
manipulation by submitting, updating and deleting content on the website in a simple to use but
powerful system. The user first registers for the service from their mobile phone or from the web
site before they can start sending entries to the website. Once the user is registered short entries
can be sent from their mobile phone to the web site. The user can edit these entries on the web
site. Alternatively they can use their mobile phones to send their entries. The application exhibits
the nature of a multi user Blog in that it can be managed and updated by different users provided
they are account holders within the Blog. Because of this multi-user aspect, the application
24
allows users, both those registered and unregistered, to read posts created by other users with
Blog accounts.
• The client-side MIDlet application which resides on the mobile device, e.g.,
mobile phone.
• The server-side JSP/MySQL based application.
5.2.1 Client-Side
The media news capture is the most important section of the MIDlet application. It
has options to capture pictures, audios as well as videos for the devices that support it. These
media can then be uploaded to the server and stored in a particular directory structure.
Server side system comprises of a web-server i.e., Apache Tomcat. The scripts are
JSP based while the backend database server is MySQL. The news contents/control instructions
sent by the MIDlet client is received at the server end and processed by the respective JSP script.
25
The JSP scripts that handle the MIDlet interaction perform various database based queries an
also helps in the generation of XML based data to be consumed by the MIDlet. It is also
responsible for dumping of media data properly. The use of XML provides ease in the generation
of data for the consumption by the MIDlet. The user-interface is a simple web-interface which
displays the news contents by fetching them form the server depending on the criteria. The
admin-interface is basically for administering the news contents form the desktop.
Since this is a client-server architecture based system, the information flow is not
standalone, rather it goes through the network and hence a communication media is needed. The
J2ME MIDlets can operate over, and make use of the WAP stack to perform HTTP network
interaction, without requiring TCP/IP. Since the server application resides on a remote machine a
connection needs to be established between the mobile device and the remote server which can
be accomplished with the use the phones with GPRS connection.
• Authentication
• Client-Side Design
• Server-Side Design
• Server Connection
• Placing Data in website
5.3.1 Authentication
what it’s packaging and labeling claims to be, or assuring that a computer program is a trusted
one. One familiar use of authentication and authorization is access control. A computer system
supposed to be used only by those authorized must attempt to detect and exclude the
unauthorized. Access to it is therefore usually controlled by insisting on an authentication
procedure to establish with some established degree of confidence the identity of the user, thence
granting those privileges as may be authorized to that identity.
This module ensures only authenticated persons can insert, delete and update data
(here the news) in the web server. This is done through the user name and password allocated to
the authenticated news reporters and maintained by the administrator.
The media news capture is the most important section of the MIDlet application. It
has options to capture videos for the devices that support it. These media can then be uploaded to
the server and stored in a particular directory structure.
The server-side system comprises of a web-server, i.e., apache. The scripts are JSP-
based while the backend database server is MySQL. The news contents/control instructions sent
by the MIDlet client is received at the server end and processed by the respective JSP page. The
Servlet that handle the MIDlet interaction perform various database based queries. The user-
interface is a simple web interface which displays the news contents by fetching them from the
server depending on the criteria. The admin-interface is basically for administering the news
contents from the desktop. The user of the site can only view the uploaded news contents. So the
view option only designed in the user-interface web page. But the administrator can upload,
27
view, edit and delete the news contents. So the admin-interface designed with the options for
performing upload, view, update and delete.
This server connecting module is used for connecting the server to the mobile
client using Stream Socket Connection. For the connection the remote desktop IP address is
given to the text box control available in the mobile application. The mobile application code get
that IP address and use it for connecting to Server application. Jar file is created using J2ME
wireless toolkit & installed into the cellular phone through the USB port.
This module involves placing the received news content from the mobile device into
the respective place in web page. The latest news placed in the home page of the web site. So
that the user of the web site can immediately know the current news with out delay. This
involves maintaining the time of the news received. Then aligning the multimedia news is
needed, for example, reduce the size of the picture sent by client into respective size that can
display in webpage.
Content
Configure System
Administrator Configure
Commands
Configure Settings
And data Configuration
Interact with request
Information
system
Settings
Process Password
Display
Messages and
Status
28
Valid ID msg
Get Details
View Content
Web-User
News
data
Video
Recorder
Video Send
username password
subject
title
User News
news audio
Content Administrator
Process
Password
Invalid Password
Valid Password
View Details
Access Denied
Web User
31
Client
Process
Password
Invalid Password
Valid Password
Configure Content
File Browser
Content type
Video Recorder
Access Denied
Video file
Send News
Input Stages
Several activities have to be carried out as a part of the overall input process. They
include
To authenticate the user the user name and password for the user is gathered by two
text boxes. Then the title of the news, subject of the news and the brief description of the news
are separately get by three more text boxes. File browse option is provided to upload the
pictures, audios and videos. These inputs are given in MIDlet application.
The username and password textboxes placed in one MIDlet form for Client Side
design and in a frame for the Server Side design. The inputs for the news entry are gathered in
separate MIDlet form in case of Client Side and in separate webpage in the case of the Server
Side.
Output design generally refers to the results and information that are generated by the
system for many end-users; output is the main reason for developing the system and the basis on
which they evaluate the usefulness of the application. In any system, the output design
determines the input to be given to the application.
The output design is an on going activity almost from the beginning of the project,
and follows the principles of form design. Effects and well define an output design improves the
relationship of system and the user, thus facilitating decision-making. A major form of output is
a hard copy from the printer, however soft copies re available.
The output of the project is a web page which displays all the uploaded news by
MIDlet application in mobile phone or the JSP file in the computer system. Various options
provided in the output design to view, edit and delete the news contents. The home page of the
site is designed as display the main options like login, view news link, contact us and the latest
news uploaded.
CHAPTER 6
35
SYSTEM TESTING
Software Testing is the process of executing a program or system with the intent of
finding errors. This is the major quality measure employed during the software engineering
development. Its basic function is to detect error in the software. Testing is necessary for the
proper functioning of the system.
• To improve quality.
6.1 OBJECTIVES
As the Philosophy behind testing is to find errors that are created with the express
intent of determining whether the system will process correctly. There are several rules that can
serve as testing objectives. They are:
• A good test case is one that has a high probability of finding an undiscovered
error.
In general, testing is finding out how well something works. In terms of human
beings, testing tells what level of knowledge or skill has been acquired. In computer hardware
and software development, testing is used at key checkpoints in the overall process to determine
whether objectives are being met. For example, in software development, product objectives are
sometimes tested by product user representatives. When the design is complete, coding follows
and the group of programmers involved; and at the system level then test the finished code at the
unit or module level by each programmer; at the component level when all components are
combined together. Evaluation is the process of determining significance or worth, usually by
careful appraisal and study. Evaluation is the analysis and comparison of actual progress vs.
prior plans, oriented toward improving plans for future implementation. It is part of a continuing
management process consisting of planning, implementation, and evaluation; ideally with each
following the other in a continuous cycle until successful completion of the activity. Evaluation
is the process of determining the worth or value of something.
A strategy for software testing integrates software test case design techniques into a
well planned series of steps that result in the successful construction of software. Any testing
strategy must incorporate test planning, test case design, test execution and the resultant data
collection and evaluation. The various software testing strategies are:
• Unit Testing
• Functional Testing
• Stress Testing
• Integration testing
Unit testing focuses on the verification effort on the smallest unit of each module in
the system. It comprises the set of tests performed by an individual programmer prior to the
integration of the unit into a larger system. It involves various tests that a programmer will
perform in a program unit.
Using the unit test plans prepared in the design of the system development as a
guide, the control paths are tested to uncover errors within the boundary of the module. In this
testing, each module is tested and it was found to be working satisfactorily as per the expected
output from the module. The unit test considerations that were taken into account are:
• Interfacing errors
• Boundary Condition
• Independent Paths
The unit test is performed in this project by checking the audio and video link are
worked properly, the options like update, delete, view and upload are worked properly and the
latest news only displayed in home page of the site.
Functional test involves exercising the code with correct input values for which the
expected results are known. The system bring developed is tested with all the nominal input
values, so that the expected results are received. The system is also tested with the boundary
values. The functional testing is performed in this project by analyzing that edit and delete
options modifies the database properly. That is they update the correct record or not.
Stress tests are designed to overload a system in various ways. The system being
developed is tested like attempting to sign on more than the maximum number of allowed
terminals, inputting mismatched data types, processing more than the allowed number of
38
identifiers. The stress testing is performed by checking the large multimedia file is properly
uploaded and stored in the web server from the mobile phone application without making delay.
This is a systematic technique for constructing the program structure while at the
same time conducting tests to uncover errors associated with the interface. In this testing all the
modules are integrated and the entire system is tested as a whole and the possibility of occurring
error are rare since it has already been unit tested. In case if any error occurs, it is found out in
this step and rectified as a whole before passing to the next step. The integration testing is
performed by checking that server connection module correctly establishes the connection to the
specified server and the placing data in web site module correctly displays the received news in
appropriate place.
The user acceptance is the key factor in the development of a successful system. The
system under consideration is tested for acceptance by constantly keeping in touch with the
prospective users at the time of development and the changes are made as and when required.
The user acceptance testing is performed for this project by analyzing the feedback of the end
user of the system that is the reports. This analyzing involves the easy use of the system, fast of
the system and interface design of the system.
39
CHAPTER 7
SYSTEM IMPLEMENTATION
The application begins working from MIDlet which is the source for input of news
content. As the MIDlet is opened a welcome screen is encountered which is followed by an
authentication interface. Authentication becomes important because of the fact that the system
will be used for administration and will require entry into a restricted area of the web site. Once
the user is authenticated properly main menu becomes visible and the user can perform the
required operations. Once the data is filled completely the upload button can be pressed to bring
us to the next screen where the confirmation of data is made. Once done we can send the data to
the server by pressing the start button.
The media creation handles the creation of multimedia files, such as, pictues, audios
and videos. The camera is initialized by use of various APIs in the MMAPI, e.g., JSR135. Once
the file is created it is transferred over the http to the remote server as multipart/form-data. The
News Manager, i.e., the editing and updating section of the application is one of the most
important sections. Once the update section is opened the user is provided with a screen where
he can select the news by clicking on it. Since the size of the mobile screen is small the data is
broken into segments, each containing five news in full. This news segment of five is then
transmitted to the MIDlet from the server in XML format. In case when more pages exist, the
news manager has an extra command option “NEXT” to jump onto the next page else the option
is not available. The use of XML is governed by the kXML parser which is a low footprint XML
parser for mobile devices. The client application discussed above was tested on the emulator
provided by J2ME wireless toolkit with JDK1.6.
Together with the client-server based system working between the mobile device and
the server there is another web-based mobile independent part of this application. This is the
website which allows the user to look through various news contents. There is an admin interface
as well for managing few features of the news like activating/deactivating the news from being
viewed and also for deleting.
40
Along with all these there is an installation script, which allows the user to properly
configure the server side of the application and set it up properly with ease. The server side of
the application is implemented using J2EE as the language and MySQL as the database server
with the use of Apache Tomcat as web-server.
41
CHAPTER 8
8.1 CONCLUSION
Once you have decided to take the plunge with Java, the next strategy is almost as
simple as avoid running computationally intensive tasks on the device. Instead, let a server
computer run them for you. The alternative is to tie up the device (potentially even making its
user interface unresponsive) for several seconds or minutes-delays that your users will find
unacceptable. In many ways, this process is similar to deploying a thin-client Web application
where most of the logic is in the web server, leaving the web browser to handle the user
interface. Finding the right balance between what to do with the device and what to do on the
server is tricky and depends on both the application and the device’s connectivity. Obviously, a
device that has a wireless radio can connect to a server more often than a device that has only
cradle based communication. But the cradle based communication is fast and essentially free,
while wireless communication can be slow and expensive. Therefore, even if you can connect to
the server on an as needed basis, it might be time-prohibitive or cost prohibitive to download
large amounts of data. Letting the server do some of the work does not have to be complicated.
42
CHAPTER 9
APPENDIX
Client code:
package com.news.cms;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.io.*;
import java.io.*;
import java.util.Date;
import com.news.cms.HttpCommandExecuter.*;
public class OptionForm extends Form implements CommandListener,Runnable
{
private final static Command CMD_EXIT = new Command("Exit", Command.EXIT, 1);
private final static Command CMD_SEND = new Command("Send News",
Command.SCREEN, 1);
private final static Command CMD_VIDEO = new Command("Video Record",
Command.SCREEN, 1);
private final static Command CMD_FILE = new Command("File Browse ",
Command.SCREEN, 1);
private static StringItem video = new StringItem("File Name:", "");
private final static Command CMD_ADMIN = new Command("admin", Command.SCREEN,
1);
private TextField tftitle,tfsubject,tfipaddress,tfnews;
private Alert alert;
private Date today = new Date(System.currentTimeMillis());
private DateField datefield = new DateField("Today", DateField.DATE);
String str;
private byte[] byteText;
public static StringBuffer videoname1 =null;
public static String videoname="null";
private MobileVideoApp parentMidlet = null;
private Form parentForm = null;
public HttpCommandExecuter httpcommandexecuter;
protected OptionForm(String in, MobileVideoApp parentMidlet_, Form parentForm_)
{
super(in);
43
this.parentMidlet = parentMidlet_;
this.parentForm = parentForm_;
initComponents();
}
public void initComponents()
{
append(JMEUtility.getImage("/images/banner.png"));
tftitle = new TextField("Title:","",20,TextField.ANY);
tfsubject = new TextField("Subject","",20,TextField.ANY);
tfnews = new TextField("News:","",50,TextField.ANY);
datefield.setDate(today);
append(datefield);
append(tftitle);
append(tfsubject);
append(tfnews);
append(video);
addCommand(CMD_EXIT);
addCommand(CMD_SEND);
addCommand(CMD_FILE);
addCommand(CMD_VIDEO);
addCommand(CMD_ADMIN);
setCommandListener(this);
}
public void editComponents()
{
}
public static void setVideoName(String name1)
{
videoname = name1;
video.setText(videoname);
videoname1 = new StringBuffer(videoname);
System.out.println("videoname"+videoname1);
}
public static String getVideoName()
{
return videoname;
}
Image[] imageArray = {JMEUtility.getImage("/images/Icon.png"),
JMEUtility.getImage("/images/Icon.png"),
JMEUtility.getImage("/images/Icon.png")};
private ChoiceGroup options = null;
private ChoiceGroup getOptions()
{
if ( options == null )
44
options = new ChoiceGroup("", Choice.EXCLUSIVE, new String[] {"Open Svr Video", "Open
Video by Id", "Record Video"}, imageArray);
return options;
}
public void commandAction(Command c, Displayable d)
{
if (c == CMD_EXIT)
{
deleteAll();
parentMidlet.destroyApp(false);
parentMidlet.notifyDestroyed();
}else if (c == CMD_SEND)
{
try
{
String tempnews = tfnews.getString();
String temptitle = tftitle.getString();
String tempsubject = tfsubject.getString();
System.out.println("videoname"+videoname);
String tempfilename ="null";
if(videoname.equals("null"))
{
System.out.println("videonamedfdsfdsf");
}
else
{
tempfilename = videoname1.toString();
}
System.out.println("videoname");
String tempdetails=temptitle+"|"+tempsubject+"|"+tempnews+"|"+ tempfilename;
System.out.println("videoname");
byteText = tempdetails.getBytes();
callServlet();
System.out.println("videoname");
}catch(Exception e)
{
System.out.println(e.toString());
}
}else if (c == CMD_ADMIN)
{
AdminForm adminform = new AdminForm("",parentMidlet,this);
parentMidlet.getDisplay().setCurrent(adminform);
}else if (c == CMD_VIDEO)
{
45
VideoRecordingForm aVideoRecordingForm =
new VideoRecordingForm("",parentMidlet,this);
parentMidlet.getDisplay().setCurrent(aVideoRecordingForm);
}else if (c == CMD_FILE)
{
FileSelector filebrowser = new FileSelector("",parentMidlet,this);
parentMidlet.getDisplay().setCurrent(filebrowser);
}
}
private void callServlet() throws IOException
{
new Thread(this).start();
}
public void run()
{
HttpConnection http = null;
InputStream ism = null;
OutputStream oStrm = null;
String url = HttpCommandExecuter.getServiceURL1();
System.out.println("url"+url);
try
{
http = (HttpConnection) Connector.open(url);
oStrm = http.openOutputStream(); // send news to server
oStrm.write(byteText);
http.setRequestMethod(HttpConnection.GET);
if (http.getResponseCode() == HttpConnection.HTTP_OK)
{
ism = http.openInputStream();
int length = (int)http.getLength();
if(length >= 0)
{
byte servletdata[] = new byte[length];
ism.read(servletdata);
str = new String(servletdata);
append("news send");
}
else
{
append("problem in reading data");
}
}
else
{
46
System.out.println("not OK");
}
}catch(Exception e)
{
append("Network error");
System.out.println(e.toString());
}
finally
{ // Clean up
if (ism != null)
{
try
{
ism.close();
}catch (Exception e)
{
System.out.println(e.toString());
}
}
if (http != null)
{
try
{
http.close();
}catch (Exception e)
{
System.out.println(e.toString());
}
}
}}}
Server code
<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*,java.util.*" errorPage="" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language="JavaScript" src= " <%=request.getContextPath()%> /js/news.js">
</SCRIPT>
<style type="text/css">
<!--
body {
background-color: #C96;
47
}
-->
</style></head>
<%!
Vector title = new Vector();
int i;
String f;
%>
<body id="newstitle">
<form name="edit" action="home" method="post">
<table width='100%'>
<tr><td align='left' width="364"> </td>
<td width="617" height="50" align='right' bgcolor='#CC9966'>
<table>
<tr>
<td colspan="2" align='center' bgcolor="#C96"> <a href="<%=request.getContextPath()%>"
target="_top" >Go To Home</a></td>
</tr></table>
</td></tr>
<tr valign='top'>
<td> </td>
<td bgcolor='#CC9966' align='left'>
<%
title = (Vector)session.getAttribute("title");
for(i = title.size() - 1; i >= 0; i--)
{
System.out.print(title.elementAt(i) + " ");
f = "";
f = "i"+i;
%>
<table bgcolor="#FFFFFF" height="42">
<tr>
<td width="256" bgcolor="#CC9966">
<p id="<%= f%>" style="display:">Title:<input id="<%= i%>" type="text"
readonly="readonly" style="border:none" value="<%= title.elementAt(i)%>" name="<%= i
%>">
<A HREF="javascript:anchor_test(<%=i%>)">edit</a><A HREF="javascript:anchor_delete(<
%= i%>)"> delete</a>
</p></td></tr></table>
<%
}
%>
</td></tr>
</table></form></body></html>
48
CHAPTER 10
REFERENCES
BOOKS
1. Bert Bates, Kathy Sierra, Bryan Basham ‘Head First Servlets and JSP’ - O’REILLY
Publications
Publications
3. Mark Matthews, Jim Cole and Joseph D. Gradecki ‘MySQL and Java Developer’s Guide,
Wiley Publications
WEBSITES
1. http://www.roseindia.net/
2. http://netbeans.org/
3. http://www.mysql.com/
4. http://java.sun.com/products/sjwtoolkit/
5. http://tomcat.apache.org/