You are on page 1of 57

1

CHAPTER 1

INTRODUCTION

Mobile Blogging or Moblogging is a form of blogging in which the


user publishes blog entries directly to the web from a mobile phone or other
mobile device. Mobile Blogging provides an instant way of accessing and
collecting personal memories. Through this relatively new technology users
are allowed to create and maintain their own personal web sites from their
mobile phone. The users update their web sites by simply sending their
images and/or text from their mobile phones. This eliminates the need for
manual maintenance of web sites. Mobile Blogging applications have
become popular as an instant way of accessing and collecting personal
memories and blog entries from mobile devices.

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

2.1 EXISTING SYSTEM

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.

2.2 PROPOSED SYSTEM

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

It finds application in news reporting agency to administer news site in real-time. A


reporter arriving at the site of the event can record the news of the current scenario from the
various sources.
Here we can upload pictures, audios and videos right at the moment to the web
server making it available to the world in no time. There are options to edit or delete and thus
provide various content management related features.

2.3 FEASIBILITY STUDY

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.

2.3.1 Technical Feasibility

The technology used can be developed with the current equipments and has the
technical capacity to hold the data required by the new system.

• This technology supports the modern trends of technology.

• Easily accessible, more secure technologies.

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.

2.3.2 Operational Feasibility

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.

2.3.3 Economical Feasibility

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

2.1 HARDWARE REQUIREMENTS

Processor : Intel Pentium Dual Core Processor


RAM : 1GB RAM
Hard Disk : 80GB Hard Disk
Keyboard : 108 Key Standard Keyboards
Mobile : Java Enabled and Video Recordable Mobile with GPRS

2.2 SOFTWARE REQUIREMENTS

Language : J2EE, J2ME


Framework : MVC
Front End : JSP, Servlet
Back End : MySQL
Web server : Apache Tomcat 5.5
Build Tools : Sun Java Wireless Toolkit 2.5.0, Net Beans IDE
6

CHAPTER 4

SOFTWARE DESCRIPTION

4.1 FRONT END

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

Figure 4.1 J2ME Architecture


 J2ME Application Lifecycle

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.

Figure 4.2 J2ME Communication

The MIDlet have 4 stages:

 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(Connected Limited Device Configuration)


 CDC (Connected Device Configuration)

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

 CLDC devices are usually wireless


 160 - 512k of memory available for Java
 Typically has limited power or battery operated
 Network connectivity, often wireless, intermittent, low-bandwidth (9600bps or less)

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.

There are number of profiles:


10

• 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.

4.1.2 MVC Architecture

Model-view-controller (MVC) is an architectural pattern, which at the same time is


also a Multi-Tier architecture, used in software engineering. In complex computer applications
that present a large amount of data to the user, a developer often wishes to separate data (model)
and user interface (view) concerns, so that changes to the user interface will not affect data
handling, and that the data can be reorganized without changing the user interface. The model-
view-controller solves this problem by decoupling data access and business logic from data
presentation and user interaction, by introducing an intermediate component: the controller.

Model

The domain-specific representation of the information on which the application


operates. Domain logic adds meaning to raw data (e.g., calculating whether today is the user's
birthday, or the totals, taxes, and shipping charges for shopping cart items).

Many applications use a persistent storage mechanism (such as a database) to store


data. MVC does not specifically mention the data access layer because it is understood to be
underneath or encapsulated by the 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.

Benefits of the MVC design pattern

The application of the model-view-controller division to the development of dynamic


Web applications has several benefits:

Figure 4.3 MVC Design 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

1. Create a prototype Web application that accesses several workstation-based


programs.
2. Change the application in response to user feedback.
3. Implement the production-level programs on the same or other platforms.

Outside of the work you do on the programs themselves, your only


adjustments are to configuration files or name-server content, not to other source code.

• 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

environment. The package javax.servlet.http defines HTTP-specific subclasses of the generic


servlet elements, including session management objects that track multiple requests and
responses between the Web server and a client. Servlets may be packaged in a WAR file as a
Web application.

Servlets can be generated automatically by JavaServer Pages (JSP), or alternately by


template engines such as WebMacro. Often servlets are used in conjunction with JSPs in a
pattern called "Model 2", which is a flavour of the model-view-controller pattern.

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.

The Servlet Run-time Environment

A servlet is a Java class and therefore needs to be executed in a Java VM by a service


we call a servlet engine. The servlet engine loads the servlet class the first time the servlet is
requested, or optionally already when the servlet engine is started. The servlet then stays loaded
to handle multiple requests until it is explicitly unloaded or the servlet engine is shut down.

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.

Life Cycle OF Servlet

The Servlet lifecycle consists of the following steps:

1. The Servlet class is loaded by the container during start-up.

2. The container calls the init() method. This method initializes


the servlet and must be called before the servlet can service
any requests. In the entire life of a servlet, the init() method
is called only once.

3. After initialization, the servlet can service client-requests.


Each request is serviced in its own separate thread. The
container calls the service() method of the servlet for every
request. The service() method determines the kind of request
being made and dispatches it to an appropriate method to
handle the request. The developer of the servlet must
provide an implementation for these methods. If a request for
a method that is not implemented by the servlet is made, the
method of the parent class is called, typically resulting in an
error being returned to the requester.

4. Finally, the container calls the destroy() method which takes


the servlet out of service. The destroy() method like init() is
called only once in the lifecycle of a Servlet.
15

Request and Response Objects

The doGet method has two interesting parameters: HttpServletRequest and


HttpServletResponse. These two objects give you full access to all information about the request
and let you control the output sent to the client as the response to the request.

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.

ServletConfig and ServletContext

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

JavaServer Pages (JSP) is a Java technology that allows software developers to


dynamically generate HTML, XML or other types of documents in response to a Web client
request. The technology allows Java code and certain pre-defined actions to be embedded into
static content.

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

Figure 4.4 Architecture of JSP

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.

The Advantages of JSP

• 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.

• Server-Side Includes (SSI). SSI is a widely-supported technology for including


externally-defined pieces into a static Web page. JSP is better because it lets you use
servlets instead of a separate program to generate that dynamic part. Besides, SSI is really
only intended for simple inclusions, not for "real" programs that use form data, make
database connections, and the like.

• 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

Java Database Connectivity (JDBC) is a programming framework for Java


developers writing programs that access information stored in databases, spreadsheets, and flat
files. JDBC is commonly used to connect a user program to a "behind the scenes" database,
regardless of what database management software is used to control the database. In this way,
JDBC is cross-platform.

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

Figure 4.5 JDBC Architecture

4.2 BACK END

4.2.1 My-SQL

MySQL is a relational database management system and delivers a multi-threaded,


multi-user Structured Query Language database server. MySQL Server is intended for
production systems as well as for embedding into mass-deployed software. MySQL is a
trademark of MySQL AB, is fast and easy to use and also has a practical set of features
developed in close co-operation with users.

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.

The MySQL Database Software is a client/server system that consists of a multi-


threaded SQL server that supports different backends, several different client programs and
libraries, administrative tools, and a wide range of programming interfaces (APIs). MySQL also
has a multi-threaded library which you can link into your application to get a smaller and faster
product.

4.3 WEB SERVER

4.3.1 Apache Tomcat

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.

The root directory of the tomcat contains the following:

• /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.

• /logs - Log files are here by default.

• /webapps - This is where your webapps go.

CHAPTER 5

PROJECT DESCRIPTION

5.1 PROBLEM DEFINITION

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.

5.2 OVERVIEW OF THE PROJECT

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.

Wireless communications is a huge field, encompassing everything from radio and


television broadcasting through pagers, mobile phones, and satellite communications. The field
of mobile phones is expanding very fast at the same time that standards and protocols are being
adopted, used, updated, and sometimes discarded. Conceptually, wireless communications can
be split into two types, local and wide area.

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.

Mobile Blogging or Moblogging is a form of Blogging in which the user publishes


Blog entries directly to the web from a mobile phone or other mobile device. Mobile Blogging
provides an instant way of accessing and collecting personal memories. Through this relatively
new technology users are allowed to create and maintain their own personal web sites from their
mobile phone. The users update their web sites by simply sending their images and/ or text from
their mobile phones. This eliminates the need for manual maintenance of web sites. Mobile
Blogging applications have become popular as an instant way of accessing and collecting
personal memories and Blog entries from mobile devices.

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 structure of the system divided into two components:

• 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 client-side system is a MIDlet application which serves as an interface to feed in


the contents and control instructions which is interpreted on the server and the appropriate action
is taken. The MIDlet has the task of creating textual news contents, creating media contents as
well as editing and updating textual news contents. The news creation task is done through a data
entry interface which contains various sections to be filled. Once done the data is uploaded to the
server and stored in the database server.

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.

Figure 5.1 Communication between MIDlet and Server

5.2.2 Server Side

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.

5.3 MODULE DESCRIPTION

In systems engineering, modular design or "modularity in design" is an approach that


subdivides a system into smaller parts (modules) that can be independently created and then used
in different systems to drive multiple functionalities. Besides reduction in cost (due to lesser
customization, and less learning time), and flexibility in design, modularity offers other benefits
such as augmentation (adding new solution by merely plugging in a new module), and exclusion.

There are five modules in this project:

• Authentication
• Client-Side Design
• Server-Side Design
• Server Connection
• Placing Data in website

5.3.1 Authentication

Authentication is the act of establishing or confirming something (or someone) as


authentic, that is, that claims made by or about the subject are true. This might involve
confirming the identity of a person, tracing the origins of an artifact, ensuring that a product is
26

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.

5.3.2 Client-Side Design

The client-side system is a MIDlet application which serves as an interface to feed in


the contents and control instructions which is interpreted on the server and the appropriate action
is taken. The MIDlet has the task of creating textual news contents, creating media contents as
well textual news contents. The news creation task is done through a data entry interface which
contains various sections to be filled. Once done the data is uploaded to the server and stored in
the database server.

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.

5.3.3 Server Side Design

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.

5.3.4 Server Connection

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.

5.3.5 Placing Data in website

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.

5.4 DATA FLOW DIAGRAM

Content
Configure System
Administrator Configure
Commands
Configure Settings
And data Configuration
Interact with request
Information
system

User Name & Add/Update Data


Password Configure

Settings

Process Password
Display
Messages and
Status
28

Valid ID msg

Get Details

Fetch web content

View Content

Web-User

Figure 5.2 Level 0 DFD Diagram

Configure Information Search


contnet
Get
Details
Configure Settings Image
file
Format File
for Browser
display
Accesss URL
Get Content Type
News
Details

News
data

Video

Recorder

Video Send

Save Classify File Get news


News
Content Details
29

Figure 5.3 Level 1 DFD Diagram

5.5 E-R DIAGRAM

username password
subject
title

User News

news audio

Figure 5.4 E-R Diagram video


30

5.6 FLOW CHART

Content Administrator

Interact with system

Process
Password

Invalid Password

Valid Password

View Details

Fetch Web Content

Access Denied

Web User
31

Figure 5.5 Server Side Flow chart

Client

Interact with Mobile

Process
Password

Invalid Password
Valid Password

Configure Content

Format for display

File Browser
Content type

Video Recorder
Access Denied
Video file

Send News

Figure 5.6 Client Side Flow Chart


32

5.7 DATABASE DESIGN

Field Datatype Description


Unique Number assigned for
Id int(10)
each user

Username varchar(20) Login id for the user


Password varchar(20) Password to login
Table 3.1 User Information Table

Field Data type Description

Unique number assigned for


Id int(10)
each user

Title varchar(30) Title for the news content

Subject varchar(30) Subject for the news content

News varchar(50) The actual news content

Image varchar(40) The path of the stored image

Date and time of the news


Days Datetime
received

Video varchar(40) Path of the stored video


Table 3.2 News Table

5.8 INPUT DESIGN

Input design is the process of converting a user-oriented description of the inputs to


a computer based business system into a program-oriented specification.
33

The objectives in the input design:

• To produce a cost-effective method of input.


• To achieve a highest possible level of accuracy.
• To ensure that input is acceptable to and understood by the user staff.

Input Stages

Several activities have to be carried out as a part of the overall input process. They
include

• Data Recording – Collection of data at its source.


• Data Description – Transfer of data to an input form
• Data Conversion – Conversion of the input data to a computer acceptable
medium.
• Data Verification – Checking the conversion
• Data Control – Checking the accuracy and controlling the flow of data to the
computer.
• Data Transmission – Transmission or transferring the data to the computer.
• Data Validation – Checking the input data by program when it enters the
computer system.
• Data Correction – Correction the errors that are found at any early stages.

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.

5.9 OUTPUT DESIGN


34

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

System testing is actually a serious of different tests whose primary purpose is to


fully exercise the computer-based system. This is to verify that all system elements have been
properly integrated and performed allocated functions. Design error-handling paths that test all
information coming from other elements of the system. Conduct a series of tests that simulate
bad data or other potential errors in the software interface.

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.

Testing is usually performed for the following purposes:

• To improve quality.

• For Verification & Validation (V&V).

• For reliability estimation.

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:

• Testing is a process of executing a program with the intent of finding an error.

• A good test case is one that has a high probability of finding an undiscovered
error.

• A successful test is one that uncovers a discovered error.


36

If testing is conducted successfully according to the objectives as started above, it


would uncover error in the software. Also testing demonstrates that software functions appear to
the working according to specification, that performance requirements appear to have been met.

6.2 TESTING EVALUATION

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.

6.3 SOFTWARE TESTING STRATEGIES

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

• User Acceptance testing.

6.3.1 Unit Testing


37

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

• Integrity of local data structure

• Boundary Condition

• Independent Paths

• Error Handling 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.

6.3.2 Functional Testing

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.

6.3.3 Stress Testing

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.

6.3.4 Integration testing

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.

6.3.5 User Acceptance testing

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

Figure 7.1 Working Environment

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

CONCLUSION AND FUTURE ENHANCEMENTS

8.1 CONCLUSION

In this project I have presented a multimedia application developed using J2ME,


J2EE and MySQL on the server side. The use of XML was a good idea keeping in mind the
future scope of the project. The application is one of its kinds and finds huge application in news
reporting agencies and e-commerce sites. An advanced version of the application is in progress
which is a more generalized mobile CMS and eligible for a large scale deployment.Thus
application provides interface for the user 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. It is 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
content administration using any smart mobile device (Java enabled and having GPRS
connectivity), which helps “Any Where Any Time” administration possible.

8.2 FUTURE ENHANCEMENTS

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

9.1 SOURCE CODE

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">&nbsp;</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>&nbsp;</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

9.2 SCREEN SHOTS

Figure 9.1 Home Page


49

Figure 9.2 Admin Login


50

Figure 8.3 Admin View Page


51

Figure 8.4 News display in Home Page


52

Figure 8.5 User View Page


53

Figure 8.6 Mobile Home Page


54

Figure 8.7 Uploading News from Mobile


55

Figure 8.8 Uploaded News Displayed in Website Home page


56

Figure 8.9 Upload Options in Mobile


57

CHAPTER 10

REFERENCES

BOOKS

1. Bert Bates, Kathy Sierra, Bryan Basham ‘Head First Servlets and JSP’ - O’REILLY

Publications

2. Eric M. Burke, Brian M. Coyner ‘Java™ Extreme Programming Cookbook’ O’REILLY

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/

You might also like