Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A project report
submitted in partial fulfilment of
the requirements for the award of the Degree of
in
Computer Science & Engineering
under the guidance of
Mr. K. A. Abdul Nazeer
by
Faiz Abdullah Y2.188
Hari S. Y2.042
Shijith T.R. Y2.091
This is to certify that the project entitled “A Smartphone Application to remotely access a
PC over the Internet” is a bonafide record of the project done by Faiz Abdullah, (Y2-
188), Hari S. (Y2.042) and Shijith T.R. (Y2.091) under our supervision and guidance.
The project report has been submitted to the Department of Computer Engineering of
National Institute of Technology Calicut in partial fulfilment of the award of the Degree
of Bachelor of Technology in Computer Science and Engineering
A Smartphone is a device that can take care of all of our handheld computing and
communication needs in a single, small package. Unlike many traditional cell phones,
Smartphones allow individual users to install, configure and run applications of their
choice. A Smartphone offers the ability to conform the device to our particular way of
doing things. Most standard cell-phone software offers only limited options for re-
configuration, forcing us to adapt to the way it is set up. On a standard phone, whether or
not we like the built-in calendar application, we are stuck with it except for a few minor
tweaks. If that phone were a Smartphone, we could install any compatible calendar
application we like.
We are deeply indebted to our project guide, Mr. K. A. Abdul Nazeer Senior Lecturer,
Computer Engineering Department, NIT Calicut and our friends for their valuable
guidance & suggestions in successfully completing our project.
Faiz Abdullah
Hari S.
Shijith T. R.
Contents
Chapters
1. Introduction …1
1.1. Motivation …1
2. System Analysis …3
2.1.1. Windows® CE …3
3. System Design …7
5. Testing …13
6. Conclusion …14
Bibliography …15
Figures
Figure
Chapter 1
INTRODUCTION
The dominance of traditional cell phones has begun to reduce and they are gradually
being replaced by powerful Smartphones, which allow us to install, run and configure
applications of our choice. For the programmer, this opens up a new area of
application development with new challenges, i.e. small display screens and limited
hardware capabilities. With the help of freely available application development tools,
we embarked upon developing a Smartphone application to remotely access a PC.
1.1 Motivation
There are times when we are away from our desktop PC back home and would like to
start some maintenance or update programs especially when we are unexpectedly
delayed or we urgently require a file from our PC having forgotten it in our system
back home or the removable media containing the copy of the file we possess fails
when needed. This project aims to resolve such issues. Smartphones are going to
dominate the next generation of mobile phones. Hence we decided to develop an
application for the Smartphone to remotely access a PC and possibly retrieve files
from the PC.
2
Chapter 2
SYSTEM ANALYSIS
modules provides full or partial support for major features of the operating system,
and can be tailored to the needs of a given eMbedded application. By selecting a
minimum set of modules and components, a device manufacturer can control the size
(“footprint”) of the operating system software while still providing the richest
possible set of APIs for developing applications and the performance of 32-bit,
preemptive multitasking, multithreaded system.
A Windows® CE program has one or more windows that receive and process
messages in a message loop. The windows can be visual or, for an application that
does not require a user interface, nonvisible. Each window has a window handle
(hwnd) associated with a message processor that handles the messages for the
window. You can also use the window handle to call any related function.
Like any other Windows-based program, a Windows® CE program has two primary
functions, a message processor (usually called WndProc) and WndMain, which
provides an entry point to the program. The WndProc function processes messages for
the Window. In general, an application processes only those messages that are
5
relevant to it, and passes other messages back to the operating system. In addition to
being the primary message process for an application, WinMain also handles
initialization and shutdown.
ActiveSync transport is not used with the emulator, but can be used with a real
Smartphone 2002 device. ActiveSync transport represents the most basic level of
connectivity between a device and the tools through Platform Manager.
TCP/IP is much faster than ActiveSync when we use it with Smartphone 2002 devices
that have a network card. When we use the emulator, the TCP/IP transport is the only
supported connectivity.
7
Chapter 3
SYSTEM DESIGN
However, reading the details of GPRS connectivity revealed that the Public Land
Mobile Network (PLMN) assigns the Smartphone a private address that is part of the
PLMN operator’s private network and is not accessible from the public network [2].
A NAT sits in between the public and private network and may be using a firewall.
Hence the PC cannot actively open a connection with the Smartphone. Only the
Smartphone can establish an active connection.
Since the domain name of the PC always remains the same, the Smartphone can
establish an active connection with the PC indicated by its domain name.
Public
Server
Chapter 4
Implementation
4.1 Shell
The process running on the PC acquires a pseudo terminal pair and then the fork
system call is used to create a child. At the parent we close the slave side of the
pseudo terminal. At the child we close the master of the pseudo terminal. Thus we
have got the communication channel set up.
The child now sets the slave of the pseudo terminal as the standard input, output and
error device. It then execs the bash shell. Hence, whatever is entered at the master
side is transmitted to the slave side and is taken as input and the resulting output (or
error) is printed into the slave side, which is eventually read by the master.
The Smartphone establishes a connection with the parent and then the parent gets
whatever is typed from the Smartphone and writes it into the master side of the
pseudo terminal. Later it reads the master to see what the output is and relays it to the
Smartphone.
The initial shell developed was able to handle only single line commands. It was
developed on a Linux host and was tested in Linux alone without communicating with
the Smartphone emulator/device. It was unable to handle character by character
transfer of commands. It was also unable to handle signals.
Later, we managed to implement the above two capabilities. The terminal input is
usually line buffered, but this does not serve our purpose. We need to have unbuffered
11
The client program, also developed using Microsoft® eMbedded Visual C++® 3.0.
As usual the client creates a socket, binds a port to the socket, and then connects to
12
the remote PC by using the host name of the PC. The hostname we have chosen is
mapped to the public IP of the PC with the help of DDNS as explained above in the
section “3.3 Present Scenario”.
4.3 Results
A shell was developed on the Linux platform for interpreting the commands entered
on the Smartphone and to send the corresponding output back to the Smartphone. An
appropriate GUI was developed for the Smartphone for entering the commands and
displaying the output. Almost all commands could be executed to a high level of
satisfaction considering the limitations imposed on us due to the display size of the
Smartphone as well as its keypad.
4.3.1 Screenshots
The following screenshots show the input and output screens for various commands
executed on the Smartphone.
Chapter 5
Testing
Before testing the application, we must ensure that the PC is connected to the internet
using a dial up or broadband connection. After establishing the connection, it must
update its leased public IP at the DDNS server using the DDNS client. Further, the
server specific program must be running.
Signals ‘CtrlC’ and ‘CtrlD’ were also tested to stop programs like ping and top. To
send commands without appending a newline character (“\n”), like ‘q’ to exit a UNIX
‘man’ page, we press the “no \n” button instead of the “Submit” button. All the above
mentioned commands executed successfully.
Chapter 6
Conclusion
6.1 Summary
A Smartphone is more than just a powerful phone that can be personalised to suit ones
needs and fancy. It is a revolutionary handheld computing device in itself. Through
this project we were able to show that it is possible to control PCs wirelessly. In fact,
the application can control the PC from any part of the world. This is an important
area of research in the digital world and a lot of work is being done to develop new as
well as better approaches and technologies for remote handheld computing.
Bibliography