You are on page 1of 97

Remote Controlled Desktop Using Android

ABSTRACT

1
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

ABSTRACT
Android based remote desktop client is a remote control system which allows you to view and
interact with one computer (known as “server”) to cellular phones (Android OS) anywhere on the
intranet. A viewer is provided on the cellular phone that enables the user to see and manipulate the
desktop of remote systems such as MS Windows. The system to be accessed must be running a
server and it must be attached to a network. A prototype of the proposed system been implemented
using Android and will be tested on a Android Virtual Device emulator. To reduce user effort and
solve problems inherent to the cellular phones small screen, several functions are provided on the
cellular viewer.

2
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Chapter 1:

1 INTRODUCTION TO PROJECT

The project scope for remote controlled desktop using android is by using the android mobile to
make the actions done without using keyboard and mouse. Android based remote desktop client is a
remote control system which allows us to view and interact with one computer to cellular phones
anywhere on the intranet. By this application our mobile phone or tablet will turn into a wireless
user-friendly remote control for our computer.

1.1 PURPOSE OF THE PROJECT

The main purpose of Remote Controlled Desktop Using Android is how to handle the
desktop with android phone without using key board or a mouse.

1.2 SCOPE OF THE PROJECT

Project scope for remote controlled desktop using android is by using the android mobile to
make the actions done without using keyboard and mouse. Android based remote desktop client is a
remote control system which allows us to view and interact with one computer to cellular phones
anywhere on the intranet.

1.3 AIM/GOAL OF THE PROJECT

This remote desktop client is a remote control system which allows you to view and interact
with one computer (known as “server”) to cellular phones (Android OS) anywhere on the intranet.
This app turns your mobile phone or tablet into a wireless user-friendly remote control for your

3
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

computer. It’ll surprise you with fully simulated touchpad, keyboard and featured remote panels
which make your remote experience simple and efficient.

1.4 FEATURES OF THE PROJECT

To reduce user effort and solve problems inherent to the cellular phones small screen,
several functions are provided on the cellular viewer.
 Supports multiple connections at the same time.
 Different work modes: "view only" and "full control".
 Different display modes: "windowed", "full screen", and "scaled".
 File transfer between local and remote computers
 Remote power management (remote shutdown, reboot, logoff, etc.)
 Strong connection security.
 Runs as a service on the NT systems.
 Works through the firewalls and supports DHCP.
 Supports high screen resolutions and color depths.
 Uses a log file to log the events and solve connection problems.

4
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Chapter 2:

2 SYSTEM ANALYSIS AND DESCRIPTION


2.1 Existing System:

In existing system we have pc operate with mouse and keyboard. User can perform the

cursor events using mouse and also click operations (left and right). User can type the text using

keyboard.

2.2 Proposed System

We are proposed to develop an application for keyboard and mouse operations with in
mobile android application. In this app we have one server (windows) and client (Android).So
client user connect with desktop using IP address and works under the wifi

2.2.1 ADVANTAGES

1) Through this web application we can save the time, we can efficiently get succeed in
implementing all the requests within short span of time.

2.3 Modules Description

2.3.1 MODULES AND FUNCTIONALITIES

2.3.1.1 Remote Connect: - By entering the computer ip address in the mobile and entering the
mobile ip address in the pc we are going to connect the android mobile with desktop and by this we
can use this as a remote.

5
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

2.3.1.2Fully Stimulated Mouse : - User can perform the cursor events using mouse and also
click operations (left and right).

2.3.1.3 Touch Opera: - The operations that we do on the keyboard the same way we can do in our
android mobile.

2.3.1.4 Keyboard: - The keyboard works same way with all the keys by using the android mobile.

2.3.1.5 Socket operations: - The operations performed in this application are user friendly.

2.4 FEASIBILITY STUDY:

The next step in analysis is to verify the feasibility of the proposed system. “All projects are
feasible given unlimited resources and infinite time“. But in reality both resources and time are
scarce. Project should confirm to time bounce and should be optimal in their consumption of
resources. This place a constant is approval of any project.

Feasibility they are 3 types:

 Technical feasibility
 Operational feasibility
 Economical feasibility

6
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

2.4.1 TECHNICAL FEASIBILITY:

To determine whether the proposed system is technically feasible, we should take into
consideration the technical issues involved behind the system.

This Application uses the web technologies, which is rampantly employed these days
worldwide. The world without the web is incomprehensible today. That goes to proposed system is
technically feasible.

2.4.2 OPERATIONAL FEASIBILITY:

To determine the operational feasibility of the system we should take into consideration the
awareness level of the users. This system is operational feasible since the users are familiar with the
technologies and hence there is no need to gear up the personnel to use system. Also the system is
very friendly and to use.

2.4.3 ECONOMIC FEASIBILITY:

To decide whether a project is economically feasible, we have to consider various factors as:

 Cost benefit analysis


 Long-term returns
 Maintenance costs
It requires average computing capabilities and access to internet, which are very basic
requirements and can be afforded by any organization hence it doesn’t incur additional economic
overheads, which renders the system economically feasible.

2.5 SDLC (SOFTWARE DEVELOPMENT LIFE CYCLE)

2.5.1 SDLC METHDOLOGIES

This document play a vital role in the development of life cycle (SDLC) as it describes the
complete requirement of the system. It means for use by developers and will be the basic
during testing phase. Any changes made to the requirements in the future will have to go
through formal change approval process.
7
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

2.5.2 SPIRAL MODEL was defined by Barry Boehm in his 1988 article, “A spiral Model
of Software Development and Enhancement. This model was not the first model to discuss
iterative development. The spiral model is similar to the incremental model, with more emphasis
placed on risk analysis. The spiral model has four phases: Planning, Risk Analysis, Engineering
and Evaluation. A software project repeatedly passes through these phases in iterations (called
Spirals in this model). The baseline spirals, starting in the planning phase, requirements are
gathered and risk is assessed. Each subsequent spiral builds on the baseline spiral.

As originally envisioned, the iterations were typically 6 months to 2 years long. Each phase
starts with a design goal and ends with a client reviewing the progress thus far. Analysis and
engineering efforts are applied at each phase of the project, with an eye toward the end goal of
the project.

The steps for Spiral Model can be generalized as follows:

 The new system requirements are defined in as much details as possible. This usually
involves interviewing a number of users representing all the external or internal users
and other aspects of the existing system.

 A preliminary design is created for the new system.

 A first prototype of the new system is constructed from the preliminary design. This is
usually a scaled-down system, and represents an approximation of the characteristics of
the final product.

 A second prototype is evolved by a fourfold procedure:

1. Evaluating the first prototype in terms of its strengths, weakness, and risks.

2. Defining the requirements of the second prototype.

3. Planning an designing the second prototype.

4. Constructing and testing the second prototype.

 At the customer option, the entire project can be aborted if the risk is deemed too great.
Risk factors might involved development cost overruns, operating-cost miscalculation,

8
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

or any other factor that could, in the customer’s judgment, result in a less-than-
satisfactory final product.

 The existing prototype is evaluated in the same manner as was the previous prototype,
and if necessary, another prototype is developed from it according to the fourfold
procedure outlined above.

 The preceding steps are iterated until the customer is satisfied that the refined prototype
represents the final product desired.

 The final system is constructed, based on the refined prototype.

 The final system is thoroughly evaluated and tested. Routine maintenance is carried on
a continuing basis to prevent large scale failures and to minimize down time.

The following diagram shows how a spiral model acts like:

9
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Fig 1.0-Spiral Model

 Planning Phase: Requirements are gathered during the planning phase. Requirements like
‘BRS’ that is ‘Business Requirement Specifications’ and ‘SRS’ that is ‘System Requirement
specifications’.

 Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and
alternate solutions. A prototype is produced at the end of the risk analysis phase. If any risk
is found during the risk analysis then alternate solutions are suggested and implemented.

 Engineering Phase: In this phase software is developed, along with testing at the end of the
phase. Hence in this phase the development and testing is done.

10
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Evaluation phase: This phase allows the customer to evaluate the output of the project
to date before the project continues to the next spiral.

Chapter 3:

3 SYSTEM DESIGN

System design is transition from a user oriented document to programmers or data base
personnel. The design is a solution, how to approach to the creation of a new system. This is
composed of several steps. It provides the understanding and procedural details necessary for
implementing the system recommended in the feasibility study. Designing goes through logical and

11
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

physical stages of development, logical design reviews the present physical system, prepare input
and output specification, details of implementation plan and prepare a logical design walkthrough.

The database tables are designed by analyzing functions involved in the system and
format of the fields is also designed. The fields in the database tables should define their role in the
system. The unnecessary fields should be avoided because it affects the storage areas of the system.
Then in the input and output screen design, the design should be made user friendly. The menu
should be precise and compact.

3.1 SOFTWARE DESIGN

In designing the software following principles are followed:

 . Modularity and partitioning: software is designed such that, each system should
consists of hierarchy of modules and serve to partition into separate function.
 Coupling: modules should have little dependence on other modules of a system.
 Cohesion: modules should carry out in a single processing function.
 Shared use: avoid duplication by allowing a single module be called by other that need
the function it provides

3.1.1 SYSTEM ARCHITECTURE DESIGN

12
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Remote Android SDK, JDK Performing


Controlled
Desktop Java Program Actions
App

3.2 INPUT/OUTPUT DESIGN


3.2.1 Input design:

Considering the requirements, procedures to collect the necessary input data in most efficiently
designed. The input design has been done keeping in view that, the interaction of the user with the
system being the most effective and simplified way.

Also the measures are taken for the following

 Controlling the amount of input


 Avoid unauthorized access to the classroom.
 Eliminating extra steps
 Keeping the process simple
 At this stage the input forms and screens are designed.

3.2.2 Output design:

13
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

All the screens of the system are designed with a view to provide the user with easy operations in
simpler and efficient way, minimum key strokes possible. Instructions and important information is
emphasized on the screen. Almost every screen is provided with no error and important messages
and option selection facilitates. Emphasis is given for speedy processing and speedy transaction
between the screens. Each screen assigned to make it as much user friendly as possible by using
interactive procedures. So to say user can operate the system without much help from the operating
manual.

3.3 SOFTWARE REQUIREMENT SPECIFICATION

3.3.1 What is SRS?

Software Requirement Specification (SRS) is the starting point of the software developing
activity. As system grew more complex it became evident that the goal of the entire system cannot
be easily comprehended. Hence the need for the requirement phase arose. The software project is
initiated by the client needs. The SRS is the means of translating the ideas of the minds of clients
(the input) into a formal document (the output of the requirement phase.)

The SRS phase consists of two basic activities:

3.3.1.1 Problem/Requirement Analysis:

The process is order and more nebulous of the two, deals with understand the
problem, the goal and constraints.

3.3.1.2 Requirement Specification:

Here, the focus is on specifying what has been found giving analysis such as
representation, specification languages and tools, and checking the specifications are
addressed during this activity.

14
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

The Requirement phase terminates with the production of the validate SRS
document. Producing the SRS document is the basic goal of this phase.

3.4 Document Conventions:

We have used Times New Roman (text size 12).Bold Font is used for Main Headings (text
size of 16). Normal font is used for sub headings (text size of 14).

Font: Times New Roman

Main Heading: Bold Font

3.5 Intended Audience and Reading Suggestions:

This document is for better understanding for Remote desktop control. Mainly intended for
Head of the Dept., Internal guide, External guide, Staff members, Users and colleagues. This detail
given below guides every normal user to how to go through this document for better understanding.
The sequence to follow for better understanding is here Purpose, Scope , Features, Operating
requirements, Modules present in the project, Advantages, References etc.

3.5.1 ROLE OF SRS

The purpose of the Software Requirement Specification is to reduce the communication gap
between the clients and the developers. Software Requirement Specification is the medium though
which the client and user needs are accurately specified. It forms the basis of software
development. A good SRS should satisfy all the parties involved in the system.

15
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.5.2 SCOPE
This software is not only used for searching for required blood group, maintaining a emergency
request on homepage and maintaining details of donors and blood banks. Also provides the
awareness about blood donation to people.

3.6 UML Concepts:

The Unified Modeling Language (UML) is a standard language for writing software blue
prints. The UML is a language for

 Visualizing
 Specifying
 Constructing
 Documenting the artifacts of a software intensive system.
The UML is a language which provides vocabulary and the rules for combining words in that
vocabulary for the purpose of communication. A modeling language is a language whose
vocabulary and the rules focus on the conceptual and physical representation of a system. Modeling
yields an understanding of a system.

3.6.1 Building Blocks of the UML:

The vocabulary of the UML encompasses three kinds of building blocks:

 Things
 Relationships
 Diagrams
Things are the abstractions that are first-class citizens in a model; relationships tie these things
together; diagrams group interesting collections of things.

16
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.6.1.1Things in the UML:

There are four kinds of things in the UML:

 Structural things
 Behavioral things
 Grouping things
 Annotational things

 Structural things are the nouns of UML models. The structural things used in the
project design are first, a class is a description of a set of objects that share the same
attributes, operations, relationships and semantics.

Window

origin

size

open()

close()

move()

display()

Fig: Classes

Second, a use case is a description of set of sequence of actions that a system performs that yields
an observable result of value to particular actor.

17
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Fig: Use Cases

Third, a node is a physical element that exists at runtime and represents a computational resource,
generally having at least some memory and often processing capability.

Fig: Nodes

 Behavioral things are the dynamic parts of UML models. The behavioral thing used is:
Interaction:

An interaction is a behavior that comprises a set of messages exchanged among a set of objects
within a particular context to accomplish a specific purpose. An interaction involves a number of
other elements, including messages, action sequences (the behavior invoked by a message, and
links (the connection between objects).

Fig: Messages

3.6.1.2 Relationships in the UML:

There are four kinds of relationships in the UML:

 Dependency

18
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Association
 Generalization
 Realization
A dependency is a semantic relationship between two things in which a change to one thing may
affect the semantics of the other thing (the dependent thing).

Fig: Dependencies

An association is a structural relationship that describes a set links, a link being a connection
among objects. Aggregation is a special kind of association, representing a structural relationship
between a whole and its parts.

Fig: Association

A generalization is a specialization/ generalization relationship in which objects of the specialized


element (the child) are substitutable for objects of the generalized element(the parent).

Fig: Generalization

A realization is a semantic relationship between classifiers, where in one classifier specifies a


contract that another classifier guarantees to carry out.

19
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Fig: Realization
3.6.1.3 Sequence Diagrams:

UML sequence diagrams are used to represent the flow of messages, events and actions between the
objects or components of a system. Time is represented in the vertical direction showing the
sequence of interactions of the header elements, which are displayed horizontally at the top of the
diagram.

Sequence Diagrams are used primarily to design, document and validate the architecture, interfaces
and logic of the system by describing the sequence of actions that need to be performed to complete
a task or scenario. UML sequence diagrams are useful design tools because they provide a dynamic
view of the system behavior which can be difficult to extract from static diagrams or specifications.

 Actor
Represents an external person or entity that interacts with the system

 Object
Represents an object in the system or one of its components

 Unit
Represents a subsystem, component, unit, or other logical entity in the system (may or may not be
implemented by objects)

20
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Separator
Represents an interface or boundary between subsystems, components or units (e.g., air interface,
Internet, network)

 Group
Groups related header elements into subsystems or components

3.6.1.4 Sequence Diagram Body Elements

 Action
Represents an action taken by an actor, object or unit

 Asynchronous Message
An asynchronous message between header elements

 Block
A block representing a loop or conditional for a particular header element

 Call Message
A call (procedure) message between header elements

21
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Create Message
A "create" message that creates a header element (represented by lifeline going from dashed to solid
pattern)

 Diagram Link
Represents a portion of a diagram being treated as a functional block. Similar to a procedure
or function call that abstracts functionality or details not shown at this level. Can optionally be
linked to another diagram for elaboration.

Else Block Represents an "else" block portion of a diagram block

 Message

A simple message between header elements

 Return Message

A return message between header elements

22
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.7 USE CASE DIAGRAM:

establish connection

enter ip address in mobile

enter mobile ip address in desktop

pc
mobile

connection had established

23
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.8 CLASS DIAGRAM:

24
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.9 SEQUENCE DIAGRAM:

pc mobile

1 : establish connection()

2 : verify mobile ip address()


3 : enter mobile ip()
4 : enter pc ip address()

5 : verify pc ip address()

6 : connection established()

7 : touch operations are performed()


8 : responces to the performed operations()

9 : stop()

25
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.10 COLLABRATION DIAGRAM:

26
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.11 ACTIVITY DIAGRAM:

27
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

connection established

enter mobile ip

no

yes
enter pc ip

yes

verify ip address

3.12 STATE CHART DIAGRAM:

28
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

establish connection

enter mobile ip address

verify mobile ip

enter pc ip address

verify pc ip

connection established

touch operations performed

response to operations performed

3.13 COMPONENT DIAGRAM:

29
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

pc mobile
enter mobile ip address

verify pc ip address enter pc ip address


verify mobile ip

responce to touch operations


perform touch operations
connection established

operations performed

stop

30
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.14 DEPLOYMENT DIAGRAM:

client data base

server

31
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.15 OBJECT DIAGRAM

3.16 HARDWARE AND SOFTWARE REQUIREMENTS:

32
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

3.16.1 Software Interfaces:

We use Java, JSP and Servlets as Programming language for writing the code for the
project. HTML, CSS and JavaScript for creating the web pages MYSQL server is used for creating
the local and global database (server). ECLIPSE IDE for writing the programs. Operating system
will be Windows XP.

3.16.2 Software Requirements

 Java
 Android SDK
 Eclipse Ganymede/Helios IDE
 Operating System can be Windows XP.

3.16.3 Hardware Requirements

 Ram : 1GB Ram and above

 Hard Disk : 50GB and above

 Processor : Dual core and above

Note: For installing this Application in to mobile device, we need android OS Mobile
phones.2.2 version android mobiles are preferable.

33
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Chapter 4:

4 IMPLEMENTATION

Introduction to Java And Its Features:

Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank and Mike
Sheridan at SUN Microsystems Incorporation in the year 1991.It took 18 months to develop the 1st
working version. This language was initially called “OAK”, but was renamed “JAVA” in 1995,
many more contributed to the design and evolution of the language.

Java programming language was originally developed by Sun Microsystems which was
initiated by James Gosling and released in 1995 as core component of Sun Microsystems' Java
platform (Java 1.0 [J2SE]).

As of December 2008, the latest release of the Java Standard Edition is 6 (J2SE). With the
advancement of Java and its widespread popularity, multiple configurations were built to suite
various types of platforms. Ex: J2EE for Enterprise Applications, J2ME for Mobile Applications.

Sun Microsystems has renamed the new J2 versions as Java SE, Java EE and Java ME
respectively. Java is guaranteed to be Write Once, Run Anywhere.

Java is:

 Object Oriented: In Java, everything is an Object. Java can be easily extended since it is
based on the Object model.
 Platform independent: Unlike many other programming languages including C and C++,
when Java is compiled, it is not compiled into platform specific machine, rather into plat-
form independent byte code. This byte code is distributed over the web and interpreted by
virtual Machine (JVM) on whichever platform it is being run.
 Simple: Java is designed to be easy to learn. If you understand the basic concept of OOP
Java would be easy to master.

34
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Secure: With Java's secure feature it enables to develop virus-free, tamper-free systems.
Authentication techniques are based on public-key encryption.
 Architectural-neutral: Java compiler generates an architecture-neutral object file format
which makes the compiled code to be executable on many processors, with the presence of
Java runtime system.
 Portable: Being architectural-neutral and having no implementation dependent aspects of
the specification makes Java portable. Compiler in Java is written in ANSI C with a clean
portability boundary which is a POSIX subset.
 Robust: Java makes an effort to eliminate error prone situations by emphasizing mainly on
compile time error checking and runtime checking.
 Multithreaded: With Java's multithreaded feature it is possible to write programs that can
do many tasks simultaneously. This design feature allows developers to construct smoothly
running interactive applications.
 Interpreted: Java byte code is translated on the fly to native machine instructions and is not
stored anywhere. The development process is more rapid and analytical since the linking is
an incremental and light weight process.
 High Performance: With the use of Just-In-Time compilers, Java enables high perfor-
mance.
 Distributed: Java is designed for the distributed environment of the internet.
 Dynamic: Java is considered to be more dynamic than C or C++ since it is designed to
adapt to an evolving environment. Java programs can carry extensive amount of run-time in-
formation that can be used to verify and resolve accesses to objects on run-time.

3.1.2 Java Overview:

Java is a powerful but lean object-oriented programming language. It has generated a lot of
excitement because it makes it possible to program for Internet by creating Applets. Programs that
can be embedded in web page. The context of an applet can be an animation with sound, an
interactive game or a ticker tape. With constantly updated stock prices. Applets can be just little
decorations to liven up web page, or they can be serious applications like Word processor or
Spreadsheet.

35
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

But Java is more than a programming language for writing Applets. It is being used more
and more for writing standalone applications as well. It is becoming so popular that many people
believe it will become standard language for both general purpose and Internet programming.

There are many buzzwords associated with Java, but because of its spectacular growth in
popularity, a new buzzword has appeared ubiquitous. Indeed, all indications are that it will soon be
everywhere.

Java builds on the strength of C++. It has taken the best features of C++ and discarded the
more problematic and error prone parts. To this lean core, it has added garbage collection
(automatic memory management), multithreading (the capacity for one program to do more than
one thing at a time), security capabilities. This result is that Java is simple, elegant, and powerful
and easy-to-use.

Java is actually a platform consisting of 3 components:

 Java Programming Language.


 Java Library of Classes and Interfaces.
 Java Virtual Machine

The following sections will say more about these components:

1. JAVA IS PORTABLE:

One of the biggest advantages Java offers is that it is portable. An application written in
Java will run on all the major platforms. Any computer with a Java-based browser can run the
applications or Applets written in the Java-Programming-Language. A programmer no longer has to
write one program to run on a Macintosh, another program to run on a Windows-machine still
another to run on a UNIX-machine and so on. In other words, with Java developers write their
programs only once.

The Virtual Machine is what gives Java is cross platform capabilities. Rather being
compiled into machine language, which is different for each OS’s and computer architecture, Java
code is compiled into Byte codes. With other

36
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Languages, the program code is compiled into a language that the computer can understand.
The problem is that other computers with different machine instruction set cannot understand that
language. Java code on the other hand is compiled into Byte-Code rather than a machine language.
These byte codes go to the JVM, which executes them directly or translates them into the language
that is understood by the machine running it.

In summary, these means that with the JDBC API extending Java, a programmer writing
Java code can access all the major RDBMS on any platform that supports the JVM.

2. JAVA IS OBJECT-ORIENTED:

The Java programming language is OBJECT-ORIENTED, which makes program design


focus on what you are dealing with, rather than on how your are going to do something. This makes
it more useful for programming in sophisticated projects, because one can break the things into
understandable components. A big benefit is that these components can then be reused.

Object-Oriented Languages use the paradigm of classes. In simplest term, a class includes
both the data and the functions to operate on data. You can create an instance of a class, also called
an object, which will have all the data members and functionality of its class. Because of this, you
can think of a class as being like template, with each object being a specific instance of a particular
type of class.

The class paradigm allows one to encapsulate data so that specific data values are those
using the data cannot see the function implementation. Encapsulation makes it possible to make the
changes in code without breaking other programs that use that code.

If for example, the implementation of a function is changed, the change is invisible to any
programmer who invokes that function, and does not affect his/her program, except hopefully to
improve it.

Java includes inheritance, or the ability to derive new classes from existing classes. The
derived class, is also called as Sub-Class, inherits all the data in the functions of the existing class.

3. JAVA DEVOLPMENT EVNIRONMENT:

37
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

To code, edit, debug and test the java programs, one needs to have a java development
environment. At the minimum this will consists of a java compiler interpreter and applet viewer
where applets can be tested. Sun’s java development kit (JDK) latest version is 2.2 can be freely
downloaded from the Internet. Java compiler is available on DOS, Win95, WIN’NT, Solaris and
MAC etc.

Data flow diagram is a graphical tool used to describe analyze the movement of data
through a system manual or automated including the processes, stores of data, and delays in the
system.
Data flow diagrams are the central tool and basis for form which other components are
developed. The data flow diagram is also known a data flow graph or bubble chart.

3.2 Introduction to AWT :

AWT stands for Abstract Window Tool Kit. It is a portable GUI library between Solaris and
Windows 95/NT and Mac System 7.X (soon) for stand-alone applications and/or applets. Since it
can be used in applets it can be used on IRIX, SunOS, HP/UX, Linux which Netscape 2.0 supports.

The Abstract Window Toolkit provides many classes for programmers to use. It is your
connection between your application and the native GUI. The AWT hides you from the underlying
details of the GUI your application will be running on and thus is at very high level of abstraction.
It takes the lowest common denominator approach to retain portability. No floating toolbars or
Balloon help here.

It is a Java package and can be used in any Java program by importing java.awt.* via
the import keyword. The documentation for the package is available at the Java homepage . The
package will be covered briefly as this document is not considered advanced material because it
does not discuss Peers, Image Consumers/Producers, Toolkits and other advanced AWT ilk. It is
recommended you look at the source code to see how the AWT really works.

The Abstract Window Toolkit supports GUI Java programming. It is a portable GUI library for
stand-alone applications and/or applets. The Abstract Window Toolkit provides the connection
between your application and the native GUI. The AWT provides a high level of abstraction for

38
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

your Java program since it hides you from the underlying details of the GUI your program will be
running on.

AWT Features Include:

 A rich set of user interface components.


 A robust event-handling model.
 Graphics and imaging tools, including shape, color, and font classes.
 Layout managers, for flexible window layouts that don't depend on a particular window size or
screen resolution.
 Data transfer classes, for cut-and-paste through the native platform clipboard.
 The AWT components depend on native code counterparts (called peers) to handle their
functionality. Thus, these components are often called "heavyweight" components.

39
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Fig: 3.2 component hierarchy of AWT

3.3 Introduction to Swings:

Swing implements a set of GUI components that build on AWT technology and provide a
pluggable look and feel. Swing is implemented entirely in the Java programming language, and is
based on the JDK 1.1 Lightweight UI Framework. Swing is a part of JFC (Java Foundation Classes)
that is used to create GUI application. It is built on the top of AWT and entirely written in java.

Swing Features Include:

 All the features of AWT.


 100% Pure Java certified versions of the existing AWT component set (Button,
Scrollbar, Label, etc.).
 A rich set of higher-level components (such as tree view, list box, and tabbed panes).
 Pure Java design, no reliance on peers.
 Pluggable Look and Feel.

40
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

 Swing components do not depend on peers to handle their functionality. Thus, these
components are often called "lightweight" components.

3.3.1 Advantage of Swing over AWT:


There are many advantages of Swing over AWT. They are as follows:

 Swing components are Platform independent.


 It is lightweight.
 It supports pluggable look and feel.
 It has more powerful components like tables, lists, scroll panes, color chooser, tabbed
pane etc.
 It follows MVC (Model View Controller) architecture.

3.3.2 Differences between AWT and Swings:

There are, of course, both pros and cons to using either set of components from the JFC in
your Java applications. Here is a summary:

AWT:
Pros:

 Speed: use of native peers speeds component performance.


 Applet Portability: most Web browsers support AWT classes so AWT applets can run
without the Java plug in.
 Look and Feel: AWT components more closely reflect the look and feel of the OS they
run on.

Cons:

 Portability: use of native peers creates platform specific limitations. Some components
may not function at all on some platforms.
 Third Party Development: the majority of component makers, including Borland and
Sun, base new component development on Swing components. There is a much smaller

41
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

set of AWT components available, thus placing the burden on the programmer to create
his or her own AWT-based components.
 Features: AWT components do not support features like icons and tool-tips.

Swing:
Pros:

 Portability: Pure Java design provides for fewer platform specific limitations.
 Behavior: Pure Java design allows for a greater range of behavior for Swing
components since they are not limited by the native peers that AWT uses.
 Features: Swing supports a wider range of features like icons and pop-up tool-tips
for components.
 Vendor Support: Swing development is more active. Sun puts much more energy
into making Swing robust.
 Look and Feel: The pluggable look and feel lets you design a single set of GUI
components that can automatically have the look and feel of any OS platform
(Microsoft Windows, Solaris, Macintosh, etc.). It also makes it easier to make global
changes to your Java programs that provide greater accessibility (like picking a hi-
contrast color scheme or changing all the fonts in all dialogs, etc.).

Cons:
 Applet Portability: Most Web browsers do not include the Swing classes, so the Java plug
in must be used.
 Performance: Swing components are generally slower and buggier than AWT, due to
both the fact that they are pure Java and to video issues on various platforms. Since
Swing components handle their own painting (rather than using native API's like DirectX
on Windows) you may run into graphical glitches.
 Look and Feel: Even when Swing components are set to use the look and feel of the OS
they are run on, they may not look like their native counterparts.

In general, AWT components are appropriate for simple applet development or


development that targets a specific platform (i.e. the Java program will run on only one

42
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

platform).

For most any other Java GUI development you will want to use Swing components. Also
note that the Borland value-added components included with JBuilder, like dbSwing and JBCL,
are based on Swing components so if you wish to use these components you will want to base
your development on Swing.

Fig: 3.3 component hierarchy of swings

3.3.3 Commonly Used Methods of Component class:


 public void add(Component c)

 public void setSize(int width,int height)

 public void setLayout(LayoutManager m)


 public void setVisible(boolean)

43
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

4.2 ANDROID TECHNOLOGY

4.7.1 Android:

Android is a mobile operating system initially developed by Android Inc. Android was
purchased by Google in 2005.[4] Android is based upon a modified version of the Linux kernel.
Google and other members of the Open Handset Alliance collaborated to develop and release
Android to the world.[5][6] The Android Open Source Project (AOSP) is tasked with the
maintenance and further development of Android.[7] Unit sales for Android OS Smartphone ranked
first among all Smartphone OS handsets sold in the U.S. in the second and third quarters of 2010,
[8][9][10] with a third quarter market share of 43.6%.[11]

Android has a large community of developers writing application programs ("apps") that extend the
functionality of the devices. There are currently over 100,000 apps available for Android.[12][13]
Android Market is the online app store run by Google, though apps can be downloaded from third
party sites (except on AT&T, which disallows this). Developers write in the Java language,
controlling the device via Google-developed Java libraries.[14]

The unveiling of the Android distribution on 5 November 2007 was announced with the founding
of the Open Handset Alliance, a consortium of 79 hardware, software, and telecom companies
devoted to advancing open standards for mobile devices.[15][16] Google released most of the
Android code under the Apache License, a free software and open source license.[17]

The Android operating system software stack consists of Java applications running on a Java based
object oriented application framework on top of Java core libraries running on a Dalvik virtual
machine featuring JIT compilation. Libraries written in C include the surface manager,
OpenCore[18] media framework, SQLite relational database management system, OpenGL ES 2.0
3D graphics API, WebKit layout engine, SGL graphics engine, SSL, and Bionic libc. The Android
operating system consists of 12 million lines of code including 3 million lines of XML, 2.8 million
lines of C, 2.1 million lines of Java, and 1.75 million lines of C++.[19]

44
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

4.7.1 The History of Google Android

The fact that hitherto dedicated devices such as mobile phones can now count themselves
among the venerable general-computing platforms is great news for programmers. This new trend
makes mobile devices accessible through general-purpose computing languages, which increases
the range and market share for mobile applications.

The Android Platform embraces the idea of general-purpose computing for handheld devices. It is
a comprehensive platform that features a Linux-based operating system stack for managing devices,
memory, and processes. Android’s libraries cover telephony, video, graphics, UI programming, and
a number of other aspects of the device.

The Android SDK supports most of the Java Platform, Standard Edition (Java SE) except for the
Abstract Window Toolkit (AWT) and Swing. In place of AWT and Swing, Android SDK has its
own extensive modern UI framework. Because you’re programming your applications in Java, you
could expect that you need a Java Virtual Machine (JVM) that is responsible for interpreting the
runtime Java byte code. A JVM typically provides the necessary optimization to help Java reach
performance levels comparable to compiled languages such as C and C++. Android offers its own
optimized JVM to run the compiled Java class files in order to counter the handheld device
limitations such as memory, processor speed, and power. This virtual machine is called the Dalvik
virtual machine.

The familiarity and simplicity of the Java programming language coupled with Android’s extensive
class library makes Android a compelling platform to write programs for.

Let us look at how Android arrived on the Mobile OS landscape. Mobile phones use a variety of
operating systems such as Symbian OS, Microsoft’s Windows Mobile, Mobile Linux,
iPhone operating system (based on Mac OS X), Moblin (from Intel), and many other proprietary
operating systems. So far no single operating system has become the de facto standard. The
available APIs and environments for developing mobile applications are too restrictive and seem to
fall behind when compared to desktop frameworks. This is where Google comes in. The Android
platform promised openness, affordability, open source code, and a high-end development
framework.

45
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Google acquired the startup company Android Inc. in 2005 to start the development of the
Android Platform The key players at Android Inc. included Andy Rubin, Rich Miner, Nick Sears,
and Chris White.

In late 2007, a group of industry leaders came together around the Android Platform to form the
Open Handset Alliance Some of the alliance’s prominent members are as follows:

Sprint Nextel
T-Mobile
Motorola
Samsung
Sony Ericsson
Toshiba
Vodafone
Google
Intel
Texas Instruments

Part of the alliance’s goal is to innovate rapidly and respond better to consumer needs, and its first
key outcome was the Android Platform. Android was designed to serve the needs of mobile
operators, handset manufacturers, and application developers. The members have committed to
release significant intellectual property through the open source Apache License, Version 2.0.

The Android SDK was first issued as an “early look” release in November 2007. In September
2008, T-Mobile announced the availability of T-Mobile G1, the first Smartphone based on the
Android platform. A few days after that, Google announced the availability of Android SDK
Release Candidate 1.0. In October 2008, Google made the source code of the Android platform
available under Apache’s open source license.

When Android was released, one of its key architectural goals was to allow applications to interact
with one another and reuse components from one another. This reuse not only applies to services,
46
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

but also to data and the user interface (UI). As a result, the Android platform has a number of
architectural features that keep this openness a reality.

Android has also attracted an early following because of its fully developed features to exploit the
cloud-computing model offered by web resources and to enhance that experience with local data
stores on the handset itself. Android’s support for a relational database on the handset also played a
part in early adoption.

In late 2008 Google released a handheld device called Android Dev Phone 1 that was capable of
running Android applications without being tied to any cell phone provider network. The goal of
this device (at an approximate cost of $400.00) was to allow developers to experiment with a real
device that could run the Android OS without any contracts. At around the same time, Google also
released a bug fix, version 1.1 of the OS, that is solely based on version 1.0. In releases 1.0 and 1.1
Android did not support soft keyboards, requiring the devices to carry physical keys. Android fixed
this issue by releasing the 1.5 SDK in April 2009, along with a number of other features, such as
advanced media-recording capabilities, widgets, and live folders.

4.8 Features:

4.8.1 Handset layouts : The platform is adaptable to larger, VGA, 2D graphics library, 3D

graphics library based on OpenGL ES 2.0 specifications, and traditional Smartphone layouts .
4.8.2 Storage: SQLite, a lightweight relational database, is used for data storage purposes

4.8.3 Connectivity : Android supports connectivity technologies including GSM/EDGE, IDEN,


CDMA, EV-DO, UMTS, Bluetooth, Wi-Fi, LTE, and WiMAX.

4.8.4 Messaging : SMS and MMS are available forms of messaging, including threaded text
messaging and now Android Cloud to Device Messaging Framework (C2DM) is also a part of
Android Push Messaging service.

47
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

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

4.8.6 Java support : While Android applications are written in Java, there's no Java Virtual
Machine in the platform and Java byte code is not executed. Java classes get recompiled into Dalvik
executable and run on Dalvik virtual machine. Dalvik is a specialized virtual machine designed
specifically for Android and optimized for battery-powered mobile devices with limited memory
and CPU. J2ME support can be provided via third-party-application such as the J2ME MIDP
Runner.[67]

4.8.7 Media support Android supports : the following audio/video/still media formats: WebM,
H.263, H.264 (in 3GP or MP4 container), MPEG-4 SP, AMR, AMR-WB (in 3GP container), AAC,
HE-AAC (in MP4 or 3GP container), MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, BMP.[66]

4.8.8 Streaming media support : RTP/RTSP streaming (3GPP PSS, ISMA), HTML progressive
download (HTML5 <video> tag). Adobe Flash Streaming (RTMP) is supported through Adobe
Flash Player plugin. Apple HTTP Live Streaming is supported through stagefright media player by
default since 2.3(Gingerbread). Microsoft Smooth Streaming is planned to be supported through the
awaited port of Silverlight plugin to Android. Adobe Flash HTTP Dynamic Streaming is planned to
be supported through an upgrade of the Flash plugin.

4.8.9 Additional hardware support : Android can use video/still cameras, touch screens, GPS,
accelerometers, gyroscopes, magnetometers, proximity and pressure sensors, thermometers,
accelerated 2D bit blits (with hardware orientation, scaling, pixel format conversion) and
accelerated 3D graphics.

4.8.10 Development environment : Includes a device emulator, tools for debugging, memory and
performance profiling. The integrated development environment (IDE) is Eclipse (currently 3.4 or
3.5) using the Android Development Tools (ADT) Plugin.

4.8.11 Market: Like many phone-based application stores, the Android Market is a catalog of
applications that can be downloaded and installed to target hardware over-the-air, without the use of
a PC. Originally only free applications were supported. Paid-for applications have been available on

48
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

the Android Market in the United States since 19 February 2009.[68] The Android Market has been
expanding rapidly. As of August 3, 2010, it had over 100,000 Android applications for download.
[69] There are other markets, such as SlideME and Getjar. Multi-touch Android has native support
for multi-touch which was initially made available in handsets such as the HTC Hero. The feature
was originally disabled at the kernel level (possibly to avoid infringing Apple's patents on touch-
screen technology).[70] Google has since released an update for the Nexus One and the Motorola
Droid which enables multi-touch natively.[71]

4.8.12 Multi-touch : Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero. The feature was originally disabled at the kernel level
(possibly to avoid infringing Apple's patents on touch-screen technology).[70] Google has since
released an update for the Nexus One and the Motorola Droid which enables multi-touch natively.
[71]

4.8.13 Bluetooth: Support for A2DP and AVRCP were added in version 1.5;[40] sending files
(OPP) and accessing the phone book (PBAP) were added in version 2.0;[46] and voice dialing and
sending contacts between phones were added in version 2.2.[51]

4.8.14 Video calling : The mainstream Android version doesn't support video calling,[72] however
some handsets could have a customized version of the operating system which supports it, either via
UMTS network (like the Samsung i9000 Galaxy S) or over IP.

4.8.15 Multitasking : Multitasking of applications is available.[73]

Voice based features : Google search through Voice is available as Search Input since initial
release.[74] Also launched Voice actions supported on Android 2.2 onwards.

4.8.16 Tethering : Android supports tethering, which allows a phone to be used as a


wireless/wired hotspot (All 2.2 Froyo phones, unofficial on phones running 1.6 or higher via
applications available in the Android Market, e.g. PdaNet). To allow a laptop to share the 3G
connection on an Android phone software may need to be installed on both the phone and the
laptop[75]

49
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

4.9 Hardware running Android

The Android OS can be used as an operating system for cellphones, netbooks and tablet
PCs, including the Dell Streak, Samsung Galaxy Tab and other devices.[76][77]

The world's first TV running Android, called Scandinavia, has also been launched by the company
People of Lava.[78]

The first commercially available phone to run the Android operating system was the HTC Dream,
released on 22 October 2008.[79]

4.10 Software development

The early feedback on developing applications for the Android platform was mixed.[80]
Issues cited include bugs, lack of documentation, inadequate QA infrastructure, and no public issue-
tracking system. (Google announced an issue tracker on 18 January 2008.)[81] In December 2007,
MergeLab mobile startup founder Adam MacBeth stated, "Functionality is not there, is poorly
documented or just doesn't work... It's clearly not ready for prime time."[82] Despite this, Android-
targeted applications began to appear the week after the platform was announced. The first publicly
available application was the Snake game.[83][84] The Android Dev Phone is a SIM-unlocked and
hardware-unlocked device that is designed for advanced developers. While developers can use
regular consumer devices purchased at retail to test and use their applications, some developers may
choose not to use a retail device, preferring an unlocked or no-contract device.

4.10.1 Software development kit

The Android software development kit (SDK) includes a comprehensive set of development
tools.[85] These include a debugger, libraries, a handset emulator (based on QEMU),
documentation, sample code, and tutorials. Currently supported development platforms include
computers running Linux (any modern desktop Linux distribution), Mac OS X 10.4.9 or later,
Windows XP or later. The officially supported integrated development environment (IDE) is
Eclipse (currently 3.4 or 3.5) using the Android Development Tools (ADT) Plugin, though

50
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

developers may use any text editor to edit Java and XML files then use command line tools (Java
Development Kit and Apache Ant are required) to create, build and debug Android applications as
well as control attached Android devices (e.g., triggering a reboot, installing software package(s)
remotely).[86]

A preview release of the Android SDK was released on 12 November 2007. On 15 July
2008, the Android Developer Challenge Team accidentally sent an email to all entrants in the
Android Developer Challenge announcing that a new release of the SDK was available in a
"private" download area. The email was intended for winners of the first round of the Android
Developer Challenge. The revelation that Google was supplying new SDK releases to some
developers and not others (and keeping this arrangement private) led to widely reported frustration
within the Android developer community at the time.[87]

On 18 August 2008 the Android 0.9 SDK beta was released. This release provided an
updated and extended API, improved development tools and an updated design for the home screen.
Detailed instructions for upgrading are available to those already working with an earlier release.
[88] On 23 September 2008 the Android 1.0 SDK (Release 1) was released.[89] According to the
release notes, it included "mainly bug fixes, although some smaller features were added". It also
included several API changes from the 0.9 version. Multiple versions have been released since.[90]

Enhancements to Android's SDK go hand in hand with the overall Android platform
development. The SDK also supports older versions of the Android platform in case developers
wish to target their applications at older devices. Development tools are downloadable components,
so after one has downloaded the latest version and platform, older platforms and tools can also be
downloaded for compatibility testing.[91]

Android applications are packaged in .apk format and stored under /data/app folder on the
Android OS (the folder is accessible to root user only for security reasons). APK package
contains .dex files[92] (compiled byte code files called Dalvik executable), resource files, etc.

4.10.2 App Inventor for Android

51
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

On 12 July 2010 Google announced the availability of App Inventor for Android, a Web-
based visual development environment for novice programmers, based on MIT's Open Blocks Java
library and providing access to Android devices' GPS, accelerometer and orientation data, phone
functions, text messaging, speech-to-text conversion, contact data, persistent storage, and Web
services, initially including Amazon and Twitter.[97] "We could only have done this because
Android’s architecture is so open," said the project director, MIT's Hal Abelson.[98] Under
development for over a year,[99] the block-editing tool has been taught to non-majors in computer
science at Harvard, MIT, Wellsley, and the University of San Francisco, where Professor David
Wolber developed an introductory computer science course and tutorial book for non-computer
science students based on App Inventor for Android.

4.10.3 Android Developer Challenge

The Android Developer Challenge was a competition for the most innovative application for
Android. Google offered prizes totaling 10 million US dollars, distributed between ADC I and ADC
II. ADC I accepted submissions from 2 January to 14 April 2008. The 50 most promising entries,
announced on 12 May 2008, each received a $25,000 award to fund further development. It ended
in early September with the announcement of ten teams that received $275,000 each, and ten teams
that received $100,000 each. ADC II was announced on 27 May 2009. The first round of the ADC
II closed on 6 October 2009.[106] The first-round winners of ADC II comprising the top 200
applications were announced on 5 November 2009. Voting for the second round also opened on the
same day and ended on November 25. Google announced the top winners of ADC II on November
30, with SweetDreams, What the Doodle!? and WaveSecure being nominated the overall winners of
the challenge.

4.10.4 Google applications

Google has also participated in the Android Market by offering several applications for its
services. These applications include Google Voice for the Google Voice service, Sky Map for
watching stars, Finance for their finance service, Maps Editor for their MyMaps service, Places
Directory for their Local Search, Google Goggles that searches by image, Gesture Search for using

52
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

finger written letters and numbers to search the contents of the phone, Google Translate, Google
Shopper, Listen for podcasts and My Tracks, a jogging application.

In August 2010, Google launched "Voice Actions for Android",[109] which allows users to search,
write messages, and initiate calls by voice.

4.11 Coding:

App Delegate.java Main Activity.java:

// Copyright 2010 Justin Taylor

// This software can be distributed under the terms of the

// GNU General Public License.

package org.example.touch;

import android.app.Application;

import android.util.Log;

import java.net.*;

public class AppDelegate extends Application {

private ClientThread client;

public int mouse_sensitivity = 1;

public boolean connected = false;

public boolean network_reachable = true;

53
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public void onCreate(){

super.onCreate();

public void createClientThread(String ipAddress, int port){

client = new ClientThread(ipAddress, port);

Thread cThread = new Thread(client);

cThread.start();

public void sendMessage(String message){

client.sendMessage(message);

public void stopServer(){

if(connected){

client.closeSocket();

54
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// ClientThread Class implementation

public class ClientThread implements Runnable {

private InetAddress serverAddr;

private int serverPort;

private DatagramSocket socket;

byte[] buf = new byte[1000];

public ClientThread(String ip, int port){

try{

serverAddr = InetAddress.getByName(ip);

catch (Exception e){

Log.e("ClientActivity", "C: Error", e);

serverPort = port;

//Opens the socket and output buffer to the remote server

public void run() {

try {

55
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

socket = new DatagramSocket();

socket.setSoTimeout(1000);

connected = testConnection();

if(connected)

surveyConnection();

catch (Exception e) {

Log.e("ClientActivity", "Client Connection Error", e);

public void sendMessage(String message){

try {

buf = message.getBytes();

DatagramPacket out = new DatagramPacket(buf, buf.length, serverAddr, serverPort);

socket.send(out);

Log.d("ClientActivity", "Sent." + message);

network_reachable = true;

catch (Exception e){

Log.e("ClientActivity", "Client Send Error:");

56
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

if(e.getMessage().equals("Network unreachable")){

Log.e("ClientActivity", "Netork UNREACHABLE!!!!:");

network_reachable = false;

closeSocketNoMessge();

public void closeSocketNoMessge(){

socket.close();

connected = false;

public void closeSocket(){

sendMessage(new String("Close"));

socket.close();

connected = false;

private boolean testConnection(){

try {

57
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Log.d("Testing", "Sending");

if(!connected)buf = new String("Connectivity").getBytes();

else buf = new String("Connected").getBytes();

DatagramPacket out = new DatagramPacket(buf, buf.length, serverAddr,


serverPort);

socket.send(out);

Log.d("Testing", "Sent");

catch(Exception e){return false;}

try{

Log.d("Testing", "Receiving");

DatagramPacket in = new DatagramPacket(buf, buf.length);

socket.receive(in);

Log.d("Testing", "Received");

return true;

catch(Exception e){return false;}

58
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

private void surveyConnection(){

int count = 0;

while(connected){

try{Thread.sleep(1000);}

catch(Exception e){}

if(!testConnection())

count++;

else

count = 0;

if(count == 3){

closeSocket();

return;

4.11.1 Controler.java Main Activity.java

59
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// Copyright 2010 Justin Taylor

// This software can be distributed under the terms of the

// GNU General Public License.

package org.example.touch;

import android.app.Activity;

import android.os.Bundle;

import android.util.Log;

import android.view.Display;

import android.view.MotionEvent;

import android.view.View.OnTouchListener;

import android.view.View.OnKeyListener;

import android.view.*;

import android.widget.Button;

import android.widget.EditText;

import android.text.Editable;

60
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

import android.text.TextWatcher;

import android.view.inputmethod.InputMethodManager;

import android.content.Context;

public class Controller extends Activity implements OnTouchListener,


OnKeyListener{

int lastXpos = 0;

int lastYpos = 0;

boolean keyboard = false;

Thread checking;

String delim = new String("!!");

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.control);

61
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Display display = getWindowManager().getDefaultDisplay();

int width = display.getWidth();

Button left = (Button) findViewById(R.id.LeftClickButton);

Button right = (Button) findViewById(R.id.RightClickButton);

left.setWidth(width/2);

right.setWidth(width/2);

View touchView = (View) findViewById(R.id.TouchPad);

touchView.setOnTouchListener(this);

EditText editText = (EditText) findViewById(R.id.KeyBoard);

editText.setOnKeyListener(this);

editText.addTextChangedListener(new TextWatcher(){

public void afterTextChanged (Editable s){

Log.d("seachScreen", ""+s);

s.clear();

}
62
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public void beforeTextChanged (CharSequence s, int start, int count, int


after){

Log.d("seachScreen", "beforeTextChanged");

public void onTextChanged (CharSequence s, int start, int before, int


count) {

AppDelegate appDel = ((AppDelegate)getApplicationContext());

try{

char c = s.charAt(start);

appDel.sendMessage("KEY"+delim+c);

catch(Exception e){}

});

public void onStart(){

super.onStart();

63
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

AppDelegate appDel = ((AppDelegate)getApplicationContext());

sendToAppDel(new String("Mouse
Sensitivity!!"+appDel.mouse_sensitivity));

new Thread(new Runnable(){

AppDelegate appDel =
((AppDelegate)getApplicationContext());

public void run(){

while(appDel.connected){

try{Thread.sleep(1000);}

catch(Exception e){};

if(!appDel.connected){

finish();

}).start();

// detect touch events

64
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// and pass them to mousePadHandler method

@Override

public boolean onTouch(View v, MotionEvent event) {

mousePadHandler(event);

return true;

// detect keyboard event

// and send to delegate

@Override

public boolean onKey(View v, int c, KeyEvent event){

Log.d("ello", ""+event.getKeyCode());

AppDelegate appDel = ((AppDelegate)getApplicationContext());

appDel.sendMessage("S_KEY"+delim+event.getKeyCode());

return false;

// send message to AppDelegate class

65
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// to be sent to server on client desktop

private void sendToAppDel(String message){

AppDelegate appDel = ((AppDelegate)getApplicationContext());

if(appDel.connected){

appDel.sendMessage(message);

else{

finish();

// send a mouse message

private void mousePadHandler(MotionEvent event) {

StringBuilder sb = new StringBuilder();

int action = event.getAction();

int touchCount = event.getPointerCount();

// if a single touch

// send movement based on action

66
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

if(touchCount == 1){

switch(action){

case 0: sb.append("DOWN"+delim);

sb.append((int)event.getX()+delim);

sb.append((int)event.getY()+delim);

break;

case 1: sb.append("UP"+delim);

sb.append(event.getDownTime()+delim);

sb.append(event.getEventTime());

break;

case 2: sb.append("MOVE"+delim);

sb.append((int)event.getX()+delim);

sb.append((int)event.getY());

break;

default: break;

67
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// if two touches

// send scroll message

// based off MAC osx multi touch

// scrolls up and down

else if(touchCount == 2){

sb.append("SCROLL"+delim);

if(action == 2){

sb.append("MOVE"+delim);

sb.append((int)event.getX()+delim);

sb.append((int)event.getY());

else

sb.append("DOWN");

sendToAppDel(sb.toString());

68
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public void LeftButtonClickHandler(View v){

Log.d("eloo", "CLICKED");

sendToAppDel("CLICK"+delim+"LEFT");

public void RightButtonClickHandler(View v){

sendToAppDel("CLICK"+delim+"RIGHT");

// Show and hide Keyboard by setting the

// focus on a hidden text field

public void keyClickHandler(View v){

EditText editText = (EditText) findViewById(R.id.KeyBoard);

InputMethodManager mgr = (InputMethodManager)


getSystemService(Context.INPUT_METHOD_SERVICE);

if(keyboard){

mgr.hideSoftInputFromWindow(editText.getWindowToken(), 0);

keyboard = false;

69
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

else{

mgr.showSoftInput(editText,
InputMethodManager.SHOW_IMPLICIT);

keyboard = true;

Log.d("SET", "Foucs");

4.11.2 Touch.java

// Copyright 2010 Justin Taylor

// This software can be distributed under the terms of the

// GNU General Public License.

package org.example.touch;

import android.app.Activity;

import android.app.AlertDialog;

import android.content.Intent;

import android.os.Bundle;

70
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

import android.view.View;

import android.content.DialogInterface;

import android.widget.EditText;

import android.widget.SeekBar;

import android.util.Log;

public class Touch extends Activity{

private EditText ipField;

private EditText portField;

private AlertDialog alert;

private AlertDialog network_alert;

private SeekBar sensitivity;

private boolean firstRun = true;

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

71
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

ipField = (EditText) findViewById(R.id.EditText01);

portField = (EditText) findViewById(R.id.EditText02);

sensitivity = (SeekBar) findViewById(R.id.SeekBar01);

ipField.setText("192.168.1.2");

portField.setText("5444");

alert = new AlertDialog.Builder(this).create();

alert.setTitle("Server Connection Unavailable");

alert.setMessage("Please make sure the server is running on your computer");

alert.setButton("Ok", new DialogInterface.OnClickListener() {

@Override

public void onClick(DialogInterface dialog, int which) {

return;

});

network_alert = new AlertDialog.Builder(this).create();

network_alert.setTitle("Network Unreachable");

network_alert.setMessage("Your device is not connected to a network.");

network_alert.setButton("Ok", new DialogInterface.OnClickListener() {

72
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

@Override

public void onClick(DialogInterface dialog, int which) {

return;

});

@Override

public void onResume(){

Log.d("RESUME", "RESUMED");

super.onResume();

AppDelegate appDel = ((AppDelegate)getApplicationContext());

if(!appDel.connected && !firstRun){

alert.show();

appDel.stopServer();

@Override

73
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public void onPause(){

super.onPause();

firstRun = false;

public void clickHandler(View view) {

AppDelegate appDel = ((AppDelegate)getApplicationContext());

int s = sensitivity.getProgress();

appDel.mouse_sensitivity = Math.round(s/20) + 1;

if(!appDel.connected){

String serverIp;

int serverPort;

serverIp = ipField.getText().toString();

serverPort = Integer.parseInt(portField.getText().toString());

appDel.createClientThread(serverIp, serverPort);

int x;

74
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

for(x=0;x<4;x++){// every quarter second for one second check if the server is
reachable

if(appDel.connected){

startActivity(new Intent(view.getContext(), Controller.class));

x = 6;

try{Thread.sleep(250);}

catch(Exception e){}

if(!appDel.connected)

if(!appDel.network_reachable)

network_alert.show();

else

alert.show();

4.11.3 AutoBoot java file:

// Copyright 2010 Justin Taylor

// This software can be distributed under the terms of the

75
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

// GNU General Public License.

import java.awt.Robot;

import java.awt.MouseInfo;

import java.awt.event.InputEvent;

import java.awt.event.KeyEvent;

import java.awt.Rectangle;

import java.awt.image.BufferedImage;

public class AutoBot {

private Robot robot;

private int mouse_sensitivity = 1;

int lastXpos = 0;

int lastYpos = 0;

int lastScrollY;

boolean special_key = true;

76
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public BufferedImage img;

public AutoBot(){

try{ robot = new Robot(); }

catch(Exception e){ System.out.println("Couldn't Create robot");}

public void handleMessage(String event){

try{

String[] tokens = event.split("!!");

if(tokens[0].equals("CLICK")){

clickMouse(tokens[1]);

else if(tokens[0].equals("Mouse Sensitivity")){

mouse_sensitivity = Integer.parseInt(tokens[1]);

77
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

else if(tokens[0].equals("MOVE")){

int currXpos = Integer.parseInt(tokens[1]);

int currYpos = Integer.parseInt(tokens[2]);

int deltaX = (lastXpos - currXpos) * -1;

int deltaY = (lastYpos - currYpos) * -1;

moveMouse(deltaX, deltaY);

lastXpos = currXpos;

lastYpos = currYpos;

//screenCap();

else if(tokens[0].equals("DOWN")){

lastXpos = Integer.parseInt(tokens[1]);

lastYpos = Integer.parseInt(tokens[2]);

else if(tokens[0].equals("UP")){

int deltaTime = Integer.parseInt(tokens[2]) -


Integer.parseInt(tokens[1]);

78
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

if(deltaTime < 250) clickMouse("LEFT");

else if(tokens[0].equals("SCROLL")){

if(tokens[1].equals("DOWN"))

lastScrollY = lastYpos;

else if(tokens[1].equals("MOVE")){

int currYpos = Integer.parseInt(tokens[3]);

int deltaY = currYpos - lastScrollY;

int tolerance = 10;

if (deltaY > tolerance){

robot.mouseWheel(1);

lastScrollY = currYpos;

if (deltaY < -1 * tolerance){

robot.mouseWheel(-1);
79
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

lastScrollY = currYpos;

//screenCap();

else if(tokens[0].equals("KEY")){

type(tokens[1].charAt(0));

else if(tokens[0].equals("S_KEY")){

if(special_key){

int key;

int key_code = Integer.parseInt(tokens[1]);

switch(key_code){

case 66: key = KeyEvent.VK_ENTER; break;

case 67: key = KeyEvent.VK_BACK_SPACE;


break;

80
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

default: key = -1; break;

keyBoardPress(key);

special_key = false;

else special_key = true;

else

System.out.println("else message" + tokens[0] +" "+


tokens[1]);

}catch(Exception e){}

public void screenCap(){

Rectangle captureSize = new Rectangle(lastXpos, lastYpos, 500, 500);

img = robot.createScreenCapture(captureSize);

81
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public BufferedImage getScreenCap(){

return img;

public void moveMouse(int x, int y){

//get the current position of the mouse cursor

int current_x_local = MouseInfo.getPointerInfo().getLocation().x;

int current_y_local = MouseInfo.getPointerInfo().getLocation().y;

//move the mouse relative to the current position

robot.mouseMove(current_x_local + x*mouse_sensitivity,

current_y_local + y*mouse_sensitivity);

public void clickMouse(String which){

int button;

if(which.equals("LEFT"))

button = InputEvent.BUTTON1_MASK;

82
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

else button = InputEvent.BUTTON3_MASK;

robot.mousePress(button);

robot.mouseRelease(button);

public void scrollMouseWheel(int notches){

robot.mouseWheel(notches);

public void type(char character) {

switch (character) {

case 'a': keyBoardPress(KeyEvent.VK_A); break;

case 'b': keyBoardPress(KeyEvent.VK_B); break;

case 'c': keyBoardPress(KeyEvent.VK_C); break;

case 'd': keyBoardPress(KeyEvent.VK_D); break;

case 'e': keyBoardPress(KeyEvent.VK_E); break;

case 'f': keyBoardPress(KeyEvent.VK_F); break;

case 'g': keyBoardPress(KeyEvent.VK_G); break;

83
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

case 'h': keyBoardPress(KeyEvent.VK_H); break;

case 'i': keyBoardPress(KeyEvent.VK_I); break;

case 'j': keyBoardPress(KeyEvent.VK_J); break;

case 'k': keyBoardPress(KeyEvent.VK_K); break;

case 'l': keyBoardPress(KeyEvent.VK_L); break;

case 'm': keyBoardPress(KeyEvent.VK_M); break;

case 'n': keyBoardPress(KeyEvent.VK_N); break;

case 'o': keyBoardPress(KeyEvent.VK_O); break;

case 'p': keyBoardPress(KeyEvent.VK_P); break;

case 'q': keyBoardPress(KeyEvent.VK_Q); break;

case 'r': keyBoardPress(KeyEvent.VK_R); break;

case 's': keyBoardPress(KeyEvent.VK_S); break;

case 't': keyBoardPress(KeyEvent.VK_T); break;

case 'u': keyBoardPress(KeyEvent.VK_U); break;

case 'v': keyBoardPress(KeyEvent.VK_V); break;

case 'w': keyBoardPress(KeyEvent.VK_W); break;

case 'x': keyBoardPress(KeyEvent.VK_X); break;

case 'y': keyBoardPress(KeyEvent.VK_Y); break;

case 'z': keyBoardPress(KeyEvent.VK_Z); break;

84
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

case 'A': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_A); break;

case 'B': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_B); break;

case 'C': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_C); break;

case 'D': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_D); break;

case 'E': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_E); break;

case 'F': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_F); break;

case 'G': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_G); break;

case 'H': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_H); break;

case 'I': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_I); break;

case 'J': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_J); break;

case 'K': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_K); break;

case 'L': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_L); break;

case 'M': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_M); break;

case 'N': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_N); break;

case 'O': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_O); break;

case 'P': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_P); break;

case 'Q': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_Q); break;

case 'R': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_R); break;

case 'S': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_S); break;

85
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

case 'T': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_T); break;

case 'U': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_U); break;

case 'V': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_V); break;

case 'W': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_W); break;

case 'X': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_X); break;

case 'Y': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_Y); break;

case 'Z': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_Z); break;

case '`': keyBoardPress(KeyEvent.VK_BACK_QUOTE); break;

case '0': keyBoardPress(KeyEvent.VK_0); break;

case '1': keyBoardPress(KeyEvent.VK_1); break;

case '2': keyBoardPress(KeyEvent.VK_2); break;

case '3': keyBoardPress(KeyEvent.VK_3); break;

case '4': keyBoardPress(KeyEvent.VK_4); break;

case '5': keyBoardPress(KeyEvent.VK_5); break;

case '6': keyBoardPress(KeyEvent.VK_6); break;

case '7': keyBoardPress(KeyEvent.VK_7); break;

case '8': keyBoardPress(KeyEvent.VK_8); break;

case '9': keyBoardPress(KeyEvent.VK_9); break;

case '-': keyBoardPress(KeyEvent.VK_MINUS); break;

86
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

case '=': keyBoardPress(KeyEvent.VK_EQUALS); break;

case '~': keyBoardPress(KeyEvent.VK_SHIFT,


KeyEvent.VK_BACK_QUOTE); break;

case '!': keyBoardPress(KeyEvent.VK_EXCLAMATION_MARK); break;

case '@': keyBoardPress(KeyEvent.VK_AT); break;

case '#': keyBoardPress(KeyEvent.VK_NUMBER_SIGN); break;

case '$': keyBoardPress(KeyEvent.VK_DOLLAR); break;

case '%': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_5); break;

case '^': keyBoardPress(KeyEvent.VK_CIRCUMFLEX); break;

case '&': keyBoardPress(KeyEvent.VK_AMPERSAND); break;

case '*': keyBoardPress(KeyEvent.VK_ASTERISK); break;

case '(': keyBoardPress(KeyEvent.VK_LEFT_PARENTHESIS); break;

case ')': keyBoardPress(KeyEvent.VK_RIGHT_PARENTHESIS); break;

case '_': keyBoardPress(KeyEvent.VK_UNDERSCORE); break;

case '+': keyBoardPress(KeyEvent.VK_PLUS); break;

case '\t': keyBoardPress(KeyEvent.VK_TAB); break;

case '\n': keyBoardPress(KeyEvent.VK_ENTER); break;

case '[': keyBoardPress(KeyEvent.VK_OPEN_BRACKET); break;

case ']': keyBoardPress(KeyEvent.VK_CLOSE_BRACKET); break;

case '\\': keyBoardPress(KeyEvent.VK_BACK_SLASH); break;


87
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

case '{': keyBoardPress(KeyEvent.VK_SHIFT,


KeyEvent.VK_OPEN_BRACKET); break;

case '}': keyBoardPress(KeyEvent.VK_SHIFT,


KeyEvent.VK_CLOSE_BRACKET); break;

case '|': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_BACK_SLASH);


break;

case ';': keyBoardPress(KeyEvent.VK_SEMICOLON); break;

case ':': keyBoardPress(KeyEvent.VK_COLON); break;

case '\'': keyBoardPress(KeyEvent.VK_QUOTE); break;

case '"': keyBoardPress(KeyEvent.VK_QUOTEDBL); break;

case ',': keyBoardPress(KeyEvent.VK_COMMA); break;

case '<': keyBoardPress(KeyEvent.VK_LESS); break;

case '.': keyBoardPress(KeyEvent.VK_PERIOD); break;

case '>': keyBoardPress(KeyEvent.VK_GREATER); break;

case '/': keyBoardPress(KeyEvent.VK_SLASH); break;

case '?': keyBoardPress(KeyEvent.VK_SHIFT, KeyEvent.VK_SLASH); break;

case ' ': keyBoardPress(KeyEvent.VK_SPACE); break;

default: System.out.println("Character " + character); break;

88
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

public void keyBoardPress(int key){

try{

robot.keyPress(key);

robot.keyRelease(key);

}catch(Exception e){}

public void keyBoardPress(int key, int key2){

try{

robot.keyPress(key);

robot.keyPress(key2);

robot.keyRelease(key2);

robot.keyRelease(key);

}catch(Exception e){}

}}

Chapter 5:

89
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

5 TESTING
5.1 SOFTWARE TESTING

Software testing is a critical element of software quality assurance and represents the ultimate
review of specification, design and code generation.
5.1.1 TESTING OBJECTIVES
 To ensure that during operation the system will perform as per specification.
 TO make sure that system meets the user requirements during operation
 To make sure that during the operation, incorrect input, processing and output will
be detected
 To see that when correct inputs are fed to the system the outputs are correct
 To verify that the controls incorporated in the same system as intended
 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 as yet undiscovered
error

The software developed has been tested successfully using the following testing strategies
and any errors that are encountered are corrected and again the part of the program or the procedure
or function is put to testing until all the errors are removed. A successful test is one that uncovers an
as yet undiscovered error.

Note that the result of the system testing will prove that the system is working correctly. It
will give confidence to system designer, users of the system, prevent frustration during
implementation process etc.,

90
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

5.2 TEST CASE DESIGN:

5.2.1 White box testing

White box testing is a testing case design method that uses the control structure of the
procedure design to derive test cases. All independents path in a module are exercised at least once,
all logical decisions are exercised at once, execute all loops at boundaries and within their
operational bounds exercise internal data structure to ensure their validity. Here the customer is
given three chances to enter a valid choice out of the given menu. After which the control exits the
current menu.

5.2.2 Black Box Testing

Black Box Testing attempts to find errors in following areas or categories, incorrect or
missing functions, interface error, errors in data structures, performance error and initialization and
termination error. Here all the input data must match the data type to become a valid entry.

The following are the different tests at various levels:

5.2.3 Unit Testing:

Unit testing is essentially for the verification of the code produced during the coding
phase and the goal is test the internal logic of the module/program. In the Generic code
project, the unit testing is done during coding phase of data entry forms whether the functions
are working properly or not. In this phase all the drivers are tested they are rightly connected
or not.

91
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

5.2.4 Integration Testing:

All the tested modules are combined into sub systems, which are then tested. The goal
is to see if the modules are properly integrated, and the emphasis being on the testing
interfaces between the modules. In the generic code integration testing is done mainly on table
creation module and insertion module.

5.2.5 Validation Testing


This testing concentrates on confirming that the software is error-free in all respects. All the
specified validations are verified and the software is subjected to hard-core testing. It also aims at
determining the degree of deviation that exists in the software designed from the specification; they
are listed out and are corrected.

5.2.6 System Testing


This testing is a series of different tests whose primary is to fully exercise the computer-
based system. This involves:

 Implementing the system in a simulated production environment and testing it.


 Introducing errors and testing for error handling.

92
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

5.3 TEST CASES


5.3.1 TEST CASE 1:

Test case for Port Number

When a user tries to connect by submitting an incorrect port number then it displays an error
message “CONNECTION CAN’T BE ESTABLISHED”.

93
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

Chapter 6:
6 RESULT
6.1 PC IP Address

Android screens:

94
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

6.2 Java
Generate Ip address:

Chapter 7:

7 CONCLUSION:
95
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

7.1 FAQ’S:

7.1.1 What is AWT?

The Abstract Window Toolkit provides many classes for programmers to use. It is your
connection between your application and the native GUI. The AWT hides you from the underlying
details of the GUI your application will be running on and thus is at very high level of abstraction.

7.1.2 What Is Swing ?

Swing implements a set of GUI components that build on AWT technology and provide a
pluggable look and feel. Swing is implemented entirely in the Java programming language and is
based on the JDK 1.1 Lightweight UI Framework. Swing is a part of JFC (Java Foundation Classes)
that is used to create GUI application. It is built on the top of AWT and entirely written in java.

BIBILIOGRAPHY
Advanced Java Programming - Dietel and Dietel

Mastering JAVA 2 - John Zukowski

Java Server Programming - Apress

Software Engineering - Roger S Pressman

Análysis & Design of InformationSystems – Senn

IDE -Eclipse with Adt Plugin


Operating System -Windows
SDK -Android Sdk 2.3
Websites:

www.eci.gov.in

www.google.com

www.apeci.com

We will be using the information collected from websites for android

96
Ideal Institute Of Technology
Remote Controlled Desktop Using Android

http://developer.android.com/index.html

http://www.android-trainer.com/

http://stackoverflow.com/

http://www.google.co.in/

97
Ideal Institute Of Technology

You might also like