You are on page 1of 32

Project Report - GPS Tracker

Pascal
Bruegger
Msc Course -
Ubiquitous
Computing
University o
!ribourg"
S#it$erlan%
Marc&
'" ())*
+
Contents
+ Backgroun%s ,
+-+ Motivations an% Goals - - - - - - - - - - - - - - - - - - - - - - - - ,
+-( State o t&e art - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
+-/ Use Cases - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .
( !unctional 0escription *
(-+ Requirements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
/ 1perational 2nstructions '
/-+ System Requirements - - - - - - - - - - - - - - - - - - - - - - - - '
/-( Sot#are - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
/-/ 3ar%#are - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - '
/-, 4rc&itecture - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +)
/-,-+ Components - - - - - - - - - - - - - - - - - - - - - - - - - +)
/-,-( Sot#are Mo%ules - - - - - - - - - - - - - - - - - - - - - - - +)
3.4.3 56B container7 %escription o 5ntity Bean an% t&e Session ++
/-,-, 85B container7 %escription o t&e 6SPs an% Servlets - - - ++
3.4.5 0atabase7 %escription o t&e tables an% relations - - - - - +*
/-,-* Mi%let7 %escription o t&e 6ava mobile application - - - - +9
/-,-: 2mplementation status - - - - - - - - - - - - - - - - - - - - +'
/-,-9 Communication bet#een mo%ules - - - - - - - - - - - - - - +'
/-,-' Package;s structure - - - - - - - - - - - - - - - - - - - - - - ()
, User;s gui%e (+
,-+ 2nstallation proce%ures - - - - - - - - - - - - - - - - - - - - - - - - (+
,-( 0o#nloa% an% les locations - - - - - - - - - - - - - - - - - - - - - ((
,-/ Tutorial - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ((
,-/-+ 8eb Client - - - - - - - - - - - - - - - - - - - - - - - - - - (/
,-/-( Mi%let - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (.
. 5valuation (.
.-+ 4%&erence #it& t&e speci cation - - - - - - - - - - - - - - - - - - (.
.-( Tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (.
.-/ <no#n Problems - - - - - - - - - - - - - - - - - - - - - - - - - - - (*
* !uture 8orks (:
*-+ To %o - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (:
*-( Possible e=tensions - - - - - - - - - - - - - - - - - - - - - - - - - - (9
: Project Management /)
:-+ Team composition - - - - - - - - - - - - - - - - - - - - - - - - - - /)
:-( 2n%ivi%ual job %escription - - - - - - - - - - - - - - - - - - - - - - /)
:-/ 5 ective in%ivi%ual contributions - - - - - - - - - - - - - - - - - /+
(
>ist o !igures
+ GPS traker7 General sc&ema - - - - - - - - - - - - - - - - - - - - ,
( Use case o t&e application - - - - - - - - - - - - - - - - - - - - - - .
/ General 4rc&itecture o GPS Tracker application - - - - - - - - - +)
, 5ntity Bean7 Class %iagram - - - - - - - - - - - - - - - - - - - - - +(
. Session Bean an% Service >ocator7 Class %iagram - - - - - - - - - +/
* 56B Container - Complete sc&ema o classes #it& associations - - +,
17 8eb Container - Sc&ema o 6SPs an% Servlets #it& associations
or #eb bro#ser access - - - - - - - - - - - - - - - - - - - - - - - - +.
18 Servlets - 4ccess rom a mobile %evice to t&e 56B using t&e servlets +*
' Mi%lets - complete arc&itecture o t&e mobile application - - - - - +9
+) Mi%lets - arc&itecture o t&e mobile application using t&e Position
list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +'
++ Communication bet#een t&e %i erent mo%ules o t&e application ()
+( User navigation 7 site map - - - - - - - - - - - - - - - - - - - - - - (/
+/ 8eb Client7 registration - - - - - - - - - - - - - - - - - - - - - - - (,
+, 8eb Client7 login - - - - - - - - - - - - - - - - - - - - - - - - - - - (.
+. 8eb Client7 ?avigation page - - - - - - - - - - - - - - - - - - - - (*
+* 8eb Client7 0ra#ing t&e track on t&e S#iss Topo map - - - - - - (:
+: Mi%let7 Main menu - - - - - - - - - - - - - - - - - - - - - - - - - - (9
+9 Mi%let7 Create a track - - - - - - - - - - - - - - - - - - - - - - - - ('
+' Mi%let7 Sen% position an% server response - - - - - - - - - - - - - /)
/
?ote o t&e aut&or7 Beore starting t&e stu%y o t&is report t&e rea%er must
&ave a goo% un%erstan%ing o t&e 6(55 an% 56B tec&nologies- T&e concept
o t&e project is presente% #it&out e=plicit speci cations o 56B (-+- 2 any
%oubt on 6(55 tec&nology" reer to @'" (A-
11 Backgroun%s
1.1 Motivations an% Goals
Security is very important in some activities- !reeri%e" mountain #alking or
climbing" paragli%ing are t&ose #&ere acci%ents can be serious or atal-
3aving t&e possibility to ollo# p&ysically t&e position o a person on regular
basis can be comortable or amily" relatives or ot&ers-
T&e project is meant to propose a simple and portable solution for people to
get traced during a trip- T&e application is web based an% s&oul% be available
or every people #&o &ave t&e possibility to
1. Run a small 6ava application on its mobile p&one-
2. 3as link bet#een a GPS %evice an% its mobile p&one-
3. 3as 2nternet access-
T&is concept is not ne# an% a lot o applications involving GPS are available
on t&e market7 no#a%ays almost every ne# car is equippe% #it& a GPS on
boar% an% &elp people in city or country si%e to n% t&eir roa%-
T&e concept o t&is project is a bit %i erent- 8e are not ocusing on "where
are we?" but more on "where he/she is?"- !or t&is t&e i%ea is to use a cell
p&one #&ic& accepts to receive GPS coor%inates an% sen% t&em to a server
able to recor% t&em un%er t&e account o a register user Btracke% personC-
T&en rom a #eb client" t&e user can be ollo#e% on a map in real time mo%e-
!igure +7 GPS traker7 General sc&ema
,
1.2 State o t&e art
4s mentione% above" t&ere are alrea%y a lot o applications #&ic& use t&e
geo-positioning- Garmin" one o t&e amous GPS manuacturer" proposes
maps o almost every countries in t&e #orl% rea%y to be %o#nloa% into t&eir
panel o GPS %evices- 0i erent kin% o applications or %i erent kin% o public7
roa% maps an% tracking" topologic maps or tec&nical job like geologist Bor
instanceC" ig&t;s map or pilots" etc-
4lso it e=ist" or mountain activities like reeri%e" &icking" t&ose automatic sig-
nalling systems #&ic& s#itc& on as soon as t&e ri%er get coug&t by an
avalanc&e or e=ample- 2t transmits a ra%io signal to t&e closest relay an%
in%icate t&e e=act position o t&e victim- 2t &elps or t&e searc& an% oten save
lives- T&e portable TomTom GPS proposes a ull navigation system #it& vocal
in%ication- T&e list o geo-positioning applications is &uge an% a simple
searc& on t&e 2n-ternet gives &un%re% #eb sites talking about t&e topic-
1.3 Use Cases
!igure (7 Use case o t&e application
T&e %iagram B gure (C s&o#s t&e use cases or t&e application- T&ere are
/ actors" +) use cases #&ic& represent or %i erent action #&at actors can %o
#it& t&e system- T&e use case Start a track is in act ( use cases- 4 track can
be starte% rom t&e #eb client or rom t&e mobile application Bcell p&one
applicationC- T&e use case Send a position is only available rom t&e mobile
.
application- 8e #ill see in t&e arc&itecture #&at is %one #&ere Bmobile vs
server applicationC-
12 !unctional 0escription
2.1 Requirements
T&e application #ill ollo# t&e use cases %escribe% in gure (- 4ll use cases
are no# %escribe% ormally-
8it&in t&e / actors" t&e manager &as a special role an% is automatically
create% #it& t&e user 2% +- 2t can %o e=actly #&at a stan%ar% user can %o but
&as special rig&ts t&at t&e ot&ers %on;t &ave-
T&e application #ill allo# to %o7
Creation o users- 4ny user #&o #ants to be ollo#e% nee%s to be register in
t&e system rst- T&e application #ill o er a #eb interace to enter t&e ollo#ing
%ata7
1. !irst ?ame
2. >ast ?ame
3. Street
4. Dip co%e
5. City
6. P&one
7. Pass#or%
T&en t&e user receives a user 2% BintegerC an% is recor%e% in t&e %atabase-
T&is part is %one on t&e #eb client si%e- T&e pass#or% must be more t&an ,
c&aracters long- 4ny el%s must be empty ot&er#ise t&e user is not register-
Mo%i cation o t&e user pro le- 1nce logge%" t&e user can mo%iy its pro le
using t&e same %ata as above an% same constraints-
User login T&is #eb page is t&e rst one in t&e system- T&e user must be
i%entiy in or%er to access any options- T&e #eb page contains t#o el%s7
1. User 2%
2. Pass#or%
T&is page proposes t&e link to t&e registration #eb page in case t&e user is
not yet register-
*
Creation o a track or a given user- T&e user" once registere%" can log in t&e
system an% create a track- T&ere is t#o possibilities to %o it7
1. !rom t&e #eb client application-
2. !rom t&e mobile application Bmobile p&oneC-
2 a ne# track is starte% rom t&e mobile application" t&e user must provi%e7
1. User 2%
2. Pass#or%
T&en t&e server #ill create a ne# track an% be rea%y to store t&e uture
positions in un%er t&is track;s i%-
!or a track starte% rom t&e #eb client" t&e user can Bbut it is not man%atoryC
give7
1. ?ort& coor%inates
2. 5ast coor%inates
T&is #ill represent t&e rst point o t&e track- T&e track &as a unique i%enti er
#it&in t&e system- T&e time an% %ate #&en t&e track is create% is taken rom
t&e server;s clock-
Sen%ing GPS coor%inates to a server using mobile %ata communica-tion- T&e
user get t&e coor%inates BpositionC rom its GPS %evice an% sen% t&em to t&e
server #it& mobile p&one- T&e position must contain7
1. User 2%
2. Time
3. ?ort& coor%inates
4. 5ast coor%inates
5. 4ltitu%e
T&en t&e server recor% t&e position un%er t&e user;s current track i%- 2 no
track is create% or t&e user 2% %oes not e=ists" t&e system gives an error
message an% %o not recor% t&e position-
!ollo# a user in real time mo%e on t&e 2nternet- 4ny person &aving t&e rig&t to
#atc& a user;s track must log in t&e system un%er t&e user;s 20 an%
pass#or%- T&en &eEs&e can c&oose t&e track to be %ra#n- 4 list o t&e user;s
tracks is available- T&is is %one t&roug& t&e #eb page- T&e %ra#ings o t&e
track are %one in t#o %i erent manners7 S#iss Topo (0 maps an% Google
5art&- 2 t&e track c&osen is t&e current one an% %ra#n in (0 mo%e" it is
reres&e% perio%ically using a Freres& timeF parameter-
:
0elete a track- T&e user can %elete tracks rom a list o tracks- 2 t&e track %elete%
is t&e current one t&en t&e previous one become again t&e current track an% all
t&e uture positions sent to t&e server #ill be save un%er t&is track i%-
Manager - 0elete users- T&e #eb page allo# t&e manager to %elete users
rom a list o register one- T&is list s&o#s all t&e available users-
Manager - !ollo# a tracke% user in real time mo%e on t&e 2nternet-
T&e manager can c&oose t&e track to be %ra#n- 4 list o all user;s tracks is
available- T&is is %one t&roug& t&e #eb page- T&e ot&er options are t&e same
as stan%ar% users-
9
13 1perational 2nstructions
T&e arc&itecture o project is base% on 5ntreprise 6avaBeans tec&nology- T&e
mobile application is %evelope% in 6ava ( Micro 5%ition-
3.1 System Requirements
T&e system nee%s %i erent &ar%#are an% sot#are components7
4n 4pplication Server 6(55 56B (-+ compatible-
4 SG> %atabase
6ava compatible mobile p&one #it& Bluetoot&
2nternet access
3.2 Sot#are
T&e 1S #&ere all t&e ollo#ing #ere installe% is 8in%o#s HP sp(7
1. 6(55 4pplication Server7 Sun 6ava System 4pplication Server Platorm
5%ition 9-+ ()).G+
2. 5ntreprise 6ava Beans (-+
3. 6ava Mi%let 7 SU? 6(M5 8ireless Tool <it (-(
4. PointBase ree Iersion7 .-( 5C! buil% (',
5. Test Bro#sers 7 !ire !o= +-)-:" 2nternet 5=plorer
6. 6ava IM 7 6(S5 Iersion +-.-) Bbuil% +-.-) )* b).C
2n a%%ition" #e &ave use% Google 5art& Bv/-)C Release ?otes - ?ovember"
()). Bv/-)-):==C- T&e 0evelopment platorm is 5clipse Iersion7 /-+-+- To built
an% %eploy t&e application H%oclet an% 4nt script le are use%-
3.3 3ar%#are
1nly t#o %evices #&ere nee%e% an% provi%e% by t&e P42 group7
1. Mobile P&one ?okia
2. GPS 5MT4C Bluetoot& - GPS Trine
T&ese t#o &ar%#are #ere use% by 1tto Pove%a or &is part o t&e
%evelopment Bcommunication bet#een GPS an% mobile P&oneC-
'
3.4 4rc&itecture
T&e tec&nologies use% or t&e project are client-server an% #eb base%- T&e main
platorm o %evelopment is 6(55- T&e ull %escription o t&e language" server
version is %escribe above- 8e #ill not e=plain in %etail &o# 6(55 #orks an%
assume t&at t&e rea%er kno#s t&is tec&nology an% &o# t&e mo%ules are %e ne%-
T&e general structure o t&e application is s&o#n in t&e gure /-
T&e application is base% on /-tiers arc&itecture7
1. Client si%e7 mobile application" #eb bro#ser
2. Server si%e7 business logic" #eb application BinteraceC
3. 0atabase
!igure /7 General 4rc&itecture o GPS Tracker application
3.4.1 Components
4s s&o#n in t&e gure /" t&ere are / main components- T&e client si%e #&ic&
contains an 6ava Mi%let application Bloa%e% in t&e mobile p&oneC an% t&e
bro#sers- T&e application server #&ic& contains t&e 8eb container B6SPs
an% servletsC an% t&e 56B container #&ere t&e business logic BSession beans
an% 5ntity beansC stan%s- T&e t&ir% tier is t&e %atabase managing t&e tables
#&ere t&e entity beans store t&eir values-
3.4.2 Sot#are Mo%ules
?o# #e enter into t&e %i erent mo%ules #&ic& are containe% in t&e main com-
ponents- 8e #ill treat t&em by %ecreasing comple=ity- !inally #e #ill %escribe
t&e communication layer bet#een t&e %i erent mo%ules-
+)
1. 56B container7 %escription o t&e Session an% 5ntity Bean
2. 85B container7 %escription o t&e 6SPs an% Servlets
3. 0atabase7 %escription o t&e tables an% relations
4. Mi%let7 %escription o t&e 6ava mobile application
3.4.3 56B container7 %escription o 5ntity Bean an% t&e Session
T&e gure , s&o#s t&e %e nition o t&e entity beans class an% t&e relation be-
t#een t&em-
Primary <ey management- T&e primary key management is implemente%
#it& an entity bean- T&e i%ea is to avoi% or t&e user to give manually a
unique key or eac& ne# position" track" a%%ress" user" etc- T&is is simply
impossible to %o it in a large scale- 4lso managing t&e primary key allo# t&e
system to be F%atabase ven%or in%epen%entF-
!or t&is #e &ave set up Prime<ey5ntityBean B!igure ,C #&ic& is linke% #it&
t&e table trackerJprimekey- T&is table &as one unique recor% #it& el%s %e ne%
in t&e section /-,-.- 5ac& time t&e entity is create%" its i% is given by calling
getPerson2%BC" get4%%ress2%" getTrack2%" etc- T&en #e increment t&e value
using setPersonBC" set4%%ress" etc-
?ote7 T&e %e nition o t&e bean classes inclu%es implicitly t&e %i erent in-
teraces nee%e% in t&e 6(55 speci cations- 4lso in a class" t&e stan%ar%
ejbCre-ateBC" ejb4ctivateBC met&o%s" etc- are un%erlying Bre @'" (AC-
T&e application uses t&e pattern Session!aca%e @+A- T&e client %oes not
access t&e entity bean %irectly but t&e session bean #&ic& provi%e met&o%s-
T#o session beans are %escribe% in t&e gure .- T&e pattern Service >ocator
&as also been implemente% in or%er to separate t&e searc& o t&e entity bean
instance eac& time t&e session bean nee%s it- !inally" t&e gure * %escribe t&e
complete component B#it& associationsC o t&e 56B container7
3.4.4 85B container7 %escription o t&e 6SPs an% Servlets
T&e gure : s&o#s t&e %i erent 6SPs an% Servlets t&at t&e 8eb container
manages @/A- T&e association represent t&e navigation bet#een t&e 6SPs-
T&is gure contains t&e #eb access 6SPs- T&e 6SPs are compose% #it&
3TM> co%e or t&e ront en% an% quite a lot o 6ava co%e #&ic& call met&o%s
in t&e session beans- 8e still nee% to %escribe t&e servlets #&ic& allo# t&e
mobile p&one to access t&e application server-
++
!igure ,7 5ntity Bean7 Class %iagram
Servlets- !our servlets are use% speci cally to interace t&e 56B container-
1. Start?e#Track-class
2. Post?e#Position-class
3. 0ra#Track-class
4. GetPoint>ist-class
T&e Start4Track servlet receives 3TTP requests rom t&e Mi%let an% calls
t&e met&o% startRemoteTrackBuser2%C in t&e TrackManagementSessionBean-
2 t&e operation is %one it sen%s t&e a string Ftrack X &as starte%F B!igure 9C-
Same principle is use% to sen% a ne# position rom t&e mobile %evice- T&e
servlet Post?e#Position receives 3TTP request an% sen%s 3TTP response
using t&e met&o%s a%%RemotePositionBC in TrackManagementSessionBean-
5=ample o t&e %oGet in t&e Start?e#Track is s&o#n un%er- 3ere #e see t&e
po#er o t&e Session aca%e- 1nce t&e client met&o% is i%enti e%" it is very
simple to interace #it& t&e entity beans-
+(
!igure .7 Session Bean an% Service >ocator7 Class %iagram
public voi% %oGetB3ttpServletRequest request" 3ttpServletResponse responseC t&ro#s
215=ception" Servlet5=ception K
response-setContentTypeBFte=tEplainFCL
Print8riter out M response-get8riterBCL
String %ata M request-getParameterBF%ataFCL
res M %ataL
i B%ata NM null OO %ata-lengt&BC P )CK
res M trackManagement-startRemoteTrackB%ataCL
Q
out-printBresCL try
K
trackManagement-removeBCL
Q catc& BRemote5=ception eC
K e-printStackTraceBCL
Q catc& BRemove5=ception eC K
e-printStackTraceBCL
Q
Q
GPS Coor%inates systems 4s rst an% important remark" t&e system o
coor%inates use% in t&e project is t&e S#iss Gri%- 2t means t&at t&e nort& an%
east coor%inates in t&e orm o ===-yyy Be=7 .*)-(/)" +:)-),)C- T&is system is
e=plain on t&e #eb site &ttp7EE###-s#isstopo-c&E-
T&e applet Track0ra#ing Be=plain un%erC is using t&is system to %ra# t&e track
+/
!igure *7 56B Container - Complete sc&ema o classes #it& associations
on t&e S#iss topo map- T&e position are save% in t&is ormat in t&e table
tracker position-
Google 5art& is using t&e system 8GS9, B%eg" min" sec-C-
0ra#ing a track To be able to %ra# a track on a map" t&e applet Track-0ra#ing is
launc&e% in t&e 6SP 0ra#-jsp- T&is applet gets a list o points rom t&e
TrackManagementSessionBean by calling t&e servlet GetPoint>ist- T&en t&e
servlet calls t&e met&o% getString1PositionByTrackBtrackC- T&e applet reres& t&e
%ra#ing #it& t&e elapse% time given as parameter B!igure :C- To get access to t&is
met&o% t&e applet must call t&e servlet ot&er#ise t&e ejb con-tainer %oes not
allo# to access its session bean #it&out special trust parameters- T&e servlet
being in t&e same application server Bsame virtual mac&ineC as t&e session bean"
it is not consi%er as ForeignerF an% can get access to t&e 56Bs- !inally"
0ra#Track is t&e servlet launc&e% in t&e vie#Track-jsp BF0ra# Track #it& Google
5art&F buttonC- 2t converts t&e list o points o t&e given track
+,
!igure :7 8eb Container - Sc&ema o 6SPs an% Servlets #it& associations or
#eb bro#ser access
into <M> ormat B!igure :C- T&e response is in t&e orm o7
response-setContentTypeBFapplicationEkey&oleFCL
out-printlnBFRS=ml versionMTF+-)TF enco%ingMTFUT!-9TFSPF CL
out-printlnBFRkml =mlnsMTF&ttp7EEeart&-google-comEkmlE(-)TFPFCL
out-printlnBFRPlacemarkPFCL
out-printlnBFR%escriptionPFU comment UFRE%escriptionPFCL
out-printlnBFRnameP Track FU track UFREnamePFCL
out-printlnBFR>ook4tPFCL
out-printlnBFRlongitu%ePFU longitu%e UFRElongitu%ePFCL
out-printlnBFRlatitu%ePFU latitu%e UFRElatitu%ePFCL
---
---
an% using t&e M2M5 type to launc& Goople 5art&- T&e <M> ormat is a HM>
base% ormat use% by Google 5art& to %escribe a track Bor instanceC- T&e
complete synta= is e=plain in @,A- Beore %ra#ing t&e track on Google 5art&"
#e &ave to translate t&e S#iss gri% ormat into 8GS9, ormat- T&is is %one
by get>ist1PositionByTrack2n<M>!ormatBtrackC- T&is met&o% calls t&e
private met&o% convertS#issGri%To8GS9,BString@A coor%inatesC #&ic&
convert eac& points into 8GS9, ormat-
+.
!igure 97 Servlets - 4ccess rom a mobile %evice to t&e 56B using t&e servlets
4pplet Track0ra#ing- T&e applet Track0ra#ing is taking as input t&e list o
points to be %ra#n an% a map in jpg ormat- 4t rst it calculate t&e ma=imum
an% minimum o t&e map coor%inates B?ort& an% 5astC given as pa-rameter
an% n% t&e ratio coordinate's range/# of pixels of the graphic window
Be=7 B.9)-.*)CE9))C- T&e grap&ic %imension are given by t&e input parameters
resolutionX, resolutionY- T&e string o points is Ftokeni$e%F an% all t&e points
are %ra#n in t&eir position accor%ing to t&e map calibration- 2 a point is out
range" it is taken in consi%eration but not %ra#n Bvirtually out o t&e mapC- T&e
points are linke% #it& simple lines-
T&e maps are jpg les an% must be calibrate%- 4s e=ample7 a map covering a
region rom ?ort& .*)-))) to .9)-))) an% 5ast +.)-))) to +:)-))) #ill &ave
.*)-)))E+.)-))) as )-)E)-)- T&e maps are save% in -EsrcE#eb Bc section /-,-'C-
3.4.5 0atabase7 %escription o t&e tables an% relations
5ac& 5ntity Bean represents t&e storage me%ium an% must correspon% to a
table in t&e %atabase- 8e going to %escribe in pseu%o SG> comman% t&e
el%s o t&e si= tables containe% in t&e %atabase S4MP>5-
T4B>5 TR4C<5RJP5RS1? B
20 2?T5G5R ?1T ?U>> C1?STR42?T P5RS1?JP<
PR2M4RV <5V" !2RST?4M5 I4RC34RB(,C ?1T ?U>>"
>4ST?4M5 I4RC34RB(,C ?1T
?U>>" 400R5SSJ20 2?T5G5R ?1T
?U>>" CRTJTR4C< 2?T5G5R ?1T
?U>>" US5RJ20 2?T5G5RCL
+*
T4B>5 TR4C<5RJ400R5SS B
20 2?T5G5R ?1T ?U>> C1?STR42?T 400R5SSJP<
PR2M4RV <5V" STR55T I4RC34RB(,C ?1T ?U>>"
D2P 2?T5G5R ?1T ?U>>" C2TV
I4RC34RB(,C ?1T ?U>>"
P31?5 I4RC34RB+(C ?1T ?U>>CL
T4B>5 TR4C<5RJP5RS1? 400 C1?STR42?T 400R5SSJ!<
!1R52G? <5V B400R5SSJ20C R5!5R5?C5S TR4C<5RJ400R5SSB20CL
T4B>5 TR4C<5RJTR4C< B
20 2?T5G5R C1?STR42?T TR4C<5RJP<
PR2M4RV <5V" 04T5 04T5 ?1T ?U>>"
ST4RTJT2M5 T2M5 ?1T
?U>>" 5?0JT2M5 T2M5 "
P5RS1?J20 2?T5G5R ?1T ?U>>CL
T4B>5 TR4C<5RJTR4C< 400 C1?STR42?T P5RS1?J!<
!1R52G? <5V BP5RS1?J20C R5!5R5?C5S TR4C<5RJP5RS1?B20CL
T4B>5 TR4C<5RJP1S2T21? B
20 2?T5G5R C1?STR42?T P1S2T21?JP<
PR2M4RV <5V" 54ST I4RC34RB9C ?1T ?U>>"
?1RT3 I4RC34RB9C ?1T ?U>>"
4>T2TU05 2?T5G5R ?1T ?U>>"
T2M5 T2M5 ?1T ?U>>" TR4C<J20
2?T5G5R ?1T ?U>>CL
T4B>5 TR4C<5RJP1S2T21? 400 C1?STR42?T TR4C<5RJ!<
!1R52G? <5V BTR4C<J20C R5!5R5?C5S TR4C<5RJTR4C<B20CL
T4B>5 TR4C<5RJPR2M5<5V B
20 2?T5G5R C1?STR42?T PR2M5<5VJP<
PR2M4RV <5V" P5RS1?J20 2?T5G5R ?1T ?U>>"
400R5SSJ20 2?T5G5R ?1T ?U>>"
TR4C<J20 2?T5G5R ?1T ?U>>"
P1S2T21?J20 2?T5G5R ?1T ?U>>CL
T4B>5 TR4C<5RJ>1G2? B
US5R20 2?T5G5R C1?STR42?T US5R20JP< PR2M4RV
<5V" P4SS81R0 I4RC34RB+.C ?1T ?U>>"
P5RS1?J20 2?T5G5R ?1T ?U>>CL
T4B>5 TR4C<5RJ>1G2? 400 C1?STR42?T P5RS1?J!<
!1R52G? <5V BP5RS1?J20C R5!5R5?C5S TR4C<5RJP5RS1?B20CL
T4B>5 TR4C<5RJP5RS1? 400 C1?STR42?T US5R20J!<
+:
!1R52G? <5V BUS5RJ20C R5!5R5?C5S TR4C<5RJ>1G2?BUS5R20CL
3.4.6 Mi%let7 %escription o t&e 6ava mobile application
T&e mobile application is %evelope% in 6ava using 6(M5 (-(- T&e general
struc-ture is s&o#n in t&e gure 9- ?o# #e %escribe more ormally t&e (
mi%lets an% t&e &elping class-
?ote7 2t is suppose% t&at t&e rea%er &as t&e necessary kno#le%ge in 6ava Mi-
%let application- 1t&er#ise reer to @." *" :" 9A-
More precisely #e &ave t&e %escription in gure ' o t&e Mi%lets arc&itecture-
4gain" only t&e met&o%s #&ic& are nee%e% to request or sen% %ata are
s&o#n- T&e Fnot %escribe%F met&o%s are usual ones in a Mi%let BMenu %e
nition" but-ton" action" etc-C- T&e met&o% a%%?ameBC request t&e user 2% in
or%er to create a track or sen% a position- invokeServlet %oes t&e &ttp request
to t&e servlet an% #ait or t&e ans#er-
!igure '7 Mi%lets - complete arc&itecture o t&e mobile application
+9
3.4.7 2mplementation status
5very mo%ule #&ic& &ave been %escribe% above are implemente%- T&e only
part o t&e project not ully implemente% is t&e Mi%lets an% especially t&e
communication #it& t&e GPS %evice- T&e communication Bluetoot& bet#een
t&e GPS an% t&e mobile p&one &as been %evelope% partly B1tto Pove%aC but
not integrate into t&e present implementation- T&e actual situation is t&at a
class Position>ist is simulating t&e GPS class an% a pre-%e ne% list o gps
coor%inates is use% to simulate t&e positions B!igure +)C- 2t is important to
realise t&at t&e actual project is only a prototype o #&at coul% be t&e
application- 4 lot o implementation %etails an% c&oices Bname o met&o%s"
security roles" etcC are not satisactory or not implemente%-
!igure +)7 Mi%lets - arc&itecture o t&e mobile application using t&e Position
list
3.4.8 Communication bet#een mo%ules
T&e communication layer is %escribe in t&e gure ++- !or t&e project" 3ttp
request bet#een mobile p&one an% server Busing GPRSC is implemente%- T&e
i%ea is to %evelop t&e SMS communication in t&e uture-
+'
!igure ++7 Communication bet#een t&e %i erent mo%ules o t&e application
3.4.9 Package;s structure
Server application- T&e application is %ivi%e% into several packages- T&e
packages liste% belo# contain t&e ollo#ing source les7
tracker-ejb-person
K 4%%ress5ntityBean-java
K Person5ntityBean-java K
>ogin5ntityBean-java
K PersonManagementSessionBean-java
tracker-ejb-track
K Position5ntityBean-java
K Track5ntityBean-java
K TrackManagementSessionBean-java
tracker-ejb-util
K Prime<ey5ntityBean-java
tracker-util
K Service>ocator-java
K Service>ocatorBase-java
()
K Service>ocator5=ception-java
K Service>ocatorSU?Remote-jav
a
tracker-ejb-#ebapp-applets
K Track0ra#ing-java
K Track0ra#ingClient-java
tracker-ejb-#ebapp-servlets
K 0ra#Track-java
K GetPoints>ist-java
K Post?e#Position-java
K Start?e#Track-java
T&e servlets an% 6SPs are save% in t&e stan%ar% B6(55 structureC
srcE#ebE %irectory-
Mobile application- T&e source le o t&e Mi%lets are save% in t&e C0-R1M
un%er --Ejava Sources eclipse-ProjectE8T<(-(-4pps an% t&e mobilTracker-ja%
is un%er E8T<(-(-appsEMobilTracker-
14 User;s gui%e
T&e application can run on a local mac&ine very easily- T&e mac&ine must
&ave t&e 6ava S0< +-." SU? application server #it& PointBase" 6ava
8ireless Tool <it (-( installe%-
4.1 2nstallation proce%ures
4pplication Server- 4t rst t&e SU? application server must be installe%
completely #it& PointBase on t&e mac&ine an% correctly con gure%- T&e
server is available in &ttp7EEjava-sun-comEj(eeE+-,E%o#nloa%-&tmlWs%k or on
t&e C0-R1M %elivere% #it& t&e application-
1nce installe% an% running" some setup &ave to be ma%e in or%er to use t&e
correct PointBase %atabase7
1. 1pen t&e server a%min console B&ttp7EElocal&ost7,9,9Ea%minguiETop!ramesetC
2. Go to Resources" 60BC" Connection Pools" PointBasePool-
3. Go to Properties an% c&eck t&at7
0atabase?ame M j%bc7pointbase7server7EElocal&ost7')'(Esample
Pass#or% M pbpublic
User M pbpublic
(+
Usually t&e %eault %omain use% is 0omain+ an% all t&e les e=tracte% rom -ear
#ill be save% un%er --E%omain+E---
0atabase- Beore t&e %eployment o t&e le ejbTracker-ear" t&e %atabase
Sample must be lle% #it& t&e tables tracker =====-
To %o it 7
1. 5nter in t&e PointBase console startConsole-bat Bun%er 8in%o#sC in in-
stall %irE4ppServerEpointbaseEtoolsEserveroption-
2. 5=ecute t&e le create-sql available in t&e C0-R1M %elivere% #it& t&e
%ocumentation an% sources-
3. 0eploy t&e ejbTracker-ear on t&e server #it& ( possibilities7
0eploy t&e application-
1. Copy t&e le ejbTracker-ear un%er install %irE4ppServerE%omainsE%omain+Eauto%eploy
2. Use t&e server a%min console go to 4pplications" 5ntreprise
4pplications" 0eploy--- an% speciy t&e le ---EejbTracker-ear-
4.2 0o#nloa% an% les locations
T&e C0-R1M given #it& t&e %ocumentation contains B%irectory an% lesC7
Ereport-presentation7 t&e project;s report an% t&e presentation in
P0!- EejbTracker project 7 t&e ejbTracker-ear" classes" create-sql"
built-=ml- Eutil 7 SU? server installer" 8T< (-(" Google 5art&-
Ereerence-%ocumentation7 all t&e P0! les mentione% in reerence-
Ejava Sources eclipse-project7 T&e complete project in 5clipse structure
BEM2TS or t&e 56B project an% E8T<(-(-4pps or t&e mobile applica-
tionC
EGPS-tracker java%oc7 java%oc-
4.3 Tutorial
T&e application is very simple to use an% very intuitive- T&e user interaces are7
1. 8eb client
2. Mi%let
((
4.3.1 8eb Client
T&e #eb client can allo# ( types o users to be log in t&e system7 +C t&e
manager (C t&e user- T&e manager is a special user an% is i%enti e% in t&e
system by t&e user 2% number F+F- 2t is in act t&e rst user to be register-
T&e gure +( s&o#s t&e #eb site map or a normal user- 8e #ill see #&at are
t&e a%%itional rig&ts t&at t&e manager &as later-
To access t&e application rom t&e #eb t&e UR>
!igure +(7 User navigation 7 site map
&ttp7EElocal&ost79)9)EejbtrackerE must be entere% in t&e bro#ser- T&is is vali%
o course i t&e server is local- T&e main page asks or a >ogin an% i t&e user
is not yet register &eEs&e must register rst- T&e user receives a user 2% an%
#ill nee% it every time &eEs&e enter in t&e system-
1nce logge% in" t&e navigation page allo# t&e user to c&ange its pro le" a%%
a ne# track" %elete a track" vie# its %i erent tracks" logout t&e system-
T&e %i erent buttons are7
Pro le setup 7 allo# t&e user to c&ange its pro le an% pass#or%-
4%% track 7 allo# t&e user to a%% a track- T&e el% coor%inates an%
altitu%e are optional- 1nce t&e track create%" all t&e positions sen% to
t&e server #ill be save% un%er t&is track 2%-
(/
!igure +/7 8eb Client7 registration
0elete 7 0elete a selecte% track rom a list- 2 t&e track is t&e current
one" t&e previous track become t&e current one-
Iie# Track7 T&e user can vie# t&e list o track an% select one rom a list-
1nce t&e track selecte%" click et !ist of points an% t&en only t&e track
can %ra#n on maps- T#o options are available7
1. 0ra# on a S#iss topo Map
2. 0ra# t&e track using Google 5art& application B#&ic& must be in-
stalle%NC
T&e manager &as t&e same Pro le setup an% >ogout as t&e stan%ar% user-
T&e %i erences are7
Users--- 7 allo# t&e manager to %elete a user-
Tracks---7 s&o# all active tracks in t&e system Ball usersC an% can %ra#
t&em #it& t&e "iew track o t&e stan%ar% user-
GPS points 7 T&e manager can mo%iy a speci c position by selecting a
track t&en t&e particular point o t&is track-
(,
!igure +,7 8eb Client7 login
4.3.2 Mi%let
4t t&at level o %evelopment" t&e mi%lets are available only #it& t&e 6ava Sim-
ulator- <toolBar o t&e 8T< must be launc&e%- Vou must open t&e project
MobilTracker an% run it-
T&e Mobile 4pplication o ers t#o menus #&ic& allo# t&e user to7
1. Create a ne# track
2. Sen% a position to t&e server
T&e option create a track #ill sen% a request to server ater t&e user provi%es its
2% as s&o#n in t&e !igure +9- 8&en a track &as starte%" you begin to sen% your
positions BGPS pointsC- T&e option Start #osition $racking propose t&e same
interace t&an t&e Start new $rack but #&en t&e user 2% as been sent" t&e tracking
starts an% every . secon%s a ne# point is sent to server B!igure +'C-
15 5valuation
5.1 4%&erence #it& t&e speci cation
Most o t&e part #&ere %evelope% ollo#ing t&e speci cations =e% at t&e be-
ginning o t&is %ocument- T&e server si%e is base% on a simple but robust
arc&itecture- 2t o ers alrea%y a relatively stable structure an% t&e entity man-
age% by t&e 56B container are #&at #e nee% at t&at stage o t&e project-
T&e 8eb client si%e is .) per cent su cient- 2t is enoug& or a proo o concept
but t&at;s all-
T&e Mi%let is enoug& or a proo o concept as #ell but nee% a serious #ork
on it-
5.2 Tests
T&e test o user an% tracks creation" %elete" sen%ing positions" %ra#ing tracks
#ere %one several times an% in very ba% con%itions7 lo# memory capacity"
(.
!igure +.7 8eb Client7 ?avigation page
mac&ine unstable #it& to many open applications" server unstable" an% so on-
Basically" t&e tests #ere %one in a pure messy %eveloper environment #it&out
any proper setup- T&e tests on t&e application itsel #ere quite successul-
T&e major problems came rom t&e SU? application server-
5.3 <no#n Problems
4s mentione% above #e &a% some problems but not as many as e=pecte%-
3ere is t&e list o most severe problems7
8e &a% one serious %atabase corruption %ue to e=ternal access an%
manual unlock o tables- T&e %atabase &a% to be recreate% BPointbase
is only an evaluation versionNC
4t least t#o times" t&e SU? application Server cras&e% an% &a% to be
re-installe%- 4gain t&e version use% is only a ree version-
T&e 3ttp session are not #ell manage%- T&e login is a real Fsecure >oginF-
8&en a user is in t&e system" an 3ttp session is create% an% its conte=t is
available %uring t&e session- But t&ere is a bug #&en no activities #&ere
%one or a long perio%7 t&e server raises an e=ception B#&ic& is goo% in
term o securityC #&en t&e client try to reres& or access t&e system- 2 #as
not able to catc& t&is e=ception an% re%irect t&e request to t&e login page
(*
!igure +*7 8eb Client7 0ra#ing t&e track on t&e S#iss Topo map
in%icating to t&e user t&at t&e session is over an% &e must aut&enticate
&imsel again-
8e &ave not succee%e% in properly saving t&e applet track0ra#ing in
t&e package tracker-ejb-#eb4pp an% use it rom &ere- 8e still nee% to
save it in t&e srcE#eb #&ere all t&e 6SPs stan% an% compile it beore-
?o real an% e cient security is setup an% t&e Mi%lets can sen% only t&e
user 20 to start a track or instance Bunacceptable in a real usageC-
16 !uture 8orks
6.1 To %o
!irst o all" t&e project at t&at stage is only a prototype- T&ere is a long list o
possible e=tensions o suc& project- But t&e %evelopment o a real program
usable on t&e 2nternet s&oul% be built #it& proessional tools like 6Boss 4ppli-
cation server" Stu%io Creator or t&e interaces" Pointbase or 1racle ull
licence" etc-
?o# coming back to t&is version o t&e project" t&e part #&ic& &as not been
%evelope% as #ante% is t&e communication bet#een GPS an% Mobile p&one-
T&at is t&e main remaining #ork or t&is prototype- 8e &ave to create a class
(:
!igure +:7 Mi%let7 Main menu
GPS #&ic& open a Bluetoot& session #it& t&e GPS an% collect t&e positions
an% sen% it to t&e class Position in an appropriate ormat- T&e class Position
must also be able in case o no communication #it& t&e server to store t&e
positions in a list an% t&en #&en possible sen% t&em all- T&e communication
using SMS s&oul% be %evelop an% an automatic s#itc& bet#een GPRS an%
SMS must be implemente%-
6.2 Possible e=tensions
3ere is a list o possible e=tension or suc& project-
Server implementation
K 4 Map 5ntity bean in or%er to c&oose t&e appropriate map accor%ing
to t&e range o coor%inate o t&e track-
K 4 %ynamic selection o coor%inate system BS#iss Gri%" 8GS 9,"
etc-C K 0e nition o t&e Roles #it&in t&e application-
(9
!igure +97 Mi%let7 Create a track
K Re-%e nition o t&e Position 5ntity bean vs simple recor%s in t&e
%atabase-
K Client interaces-
K 8eb pages to be re-looke%-
Grap&ics
K 0ynamically c&ange t&e vie# on a map B$oom in-outC-
K 2nterace #it& Google 5art& real timeN
Mobile communication
K !inalise t&e GPS-Mobile P&one communication-
K 4bstract communication layer 7 automatic s#itc& bet#een %i erent
type o communication BGPRS" SMS" 82!2" etc-C-
K SMS communication-
K Mobile grap&ic interace to ollo# an ot&er user-
('
!igure +'7 Mi%let7 Sen% position an% server response
17 Project Management
T&e project #as suppose% to be %evelope% in a team o ( stu%ents-
7.1 Team composition
T&e team is compose% by7
Pascal Bruegger
1tto Pove%a
7.2 2n%ivi%ual job %escription
1. Pascal Bruegger7
(1) 4nalysis an% implementation o t&e entity BpersistenceC an%
session beans
(2) 4nalysis an% implementation o t&e 8eb client B6SPsC
(3) 2mplementation o t&e interace or t&e Mobile application BservletsC-
2. 1tto Pove%a7
(1) 4nalysis an% implementation o t&e Bluetoot& communication be-
t#een t&e GPS %evice an% t&e mobile p&one-
(2) 4nalysis an% implementation o t&e Mi%let requesting positions to
t&e GPS-
/)
(3) 2mplementation o t&e Mi%let starting a track an% sen%ing ormatte%
position to server Busing t&e servletsC-
7.3 5 ective in%ivi%ual contributions
1. Pascal Bruegger7
(1) 4nalysis an% implementation o t&e entity BpersistenceCan% session
beans-
(2) 4nalysis an% implementation o t&e 8eb client B6SPsC-
(3) 2nterace #it& Google 5art& Bnot %e ne% at t&e beginningC-
(4) 2mplementation o t&e interace or t&e Mobile application-
(5) 2mplementation o t&e Mi%let starting a track an% sen% ormatte%
position to server Busing t&e servletsC-
2. 1tto Pove%a7
(1) 2mplementation o t&e Bluetoot& communication bet#een t&e GPS
%evice an% t&e mobile p&one-
(2) 2mplementation o t&e Mi%let requesting t&e GPS partly %one-
T&e #ork %one or t&e project presente% in t&is %ocument an% in t&e class
room represent about (.) to /)) &ours o #ork or t&e aut&or- T&is part o t&e
project &as been entirely %evelope% by Pascal Bruegger an% t&e part
inclu%ing t&e GPS communication #it& t&e mobile p&one #ill be %elivere% by
1tto Pove%a Bsource an% %ocumentationC separately-
/+
Reerences
[1] 6o&n Crupi 0eepak 4lur an% Malks- %ore &'(( #atterns ) 'nd (dition-
SU? microsystem" ()),-
[2] 6- Ball 5- 4rmstrong an% S- Bo%o - $he &'(( *+, $utorial- ###-sun-com"
()).-
[3] Cra#or% !arley an% !lanagan- &a-a (nterprise, 'nd (dition- 1;Reilly"
())/-
[4] Google- oogle (arth ./! '+0
- &ttp7EE###-key&ole-comEkmlE%ocsEGoogle 5art& <M>-p%" ()),-
[5] Gusay 3- Ma&mou%- /12# (-ent 3andling
- &ttp7EE%evelopers-sun-comEtec&topicsEmobilityEmi%pEarticlesEeventE" ()),-
[6] Gusay 3- Ma&mou%- /12# 1nter)%ommunication with %1 and Ser-lets
- &ttp7EE%evelopers-sun-comEtec&topicsEmobilityEmi%pEarticlesEeventE" ()),-
@:A Gusay 3- Ma&mou%- 4ireless 5pplication #rogram)
ming6 /12# #rogramming and #ackaging 7asics-
&ttp7EE%evelopers-sun-comEtec&topicsEmobilityEmi%pEarticlesEeventE"
()),-
[8] Sun Microsystem- 8ser's uide ) 4ireless $ool.it -ersion *+0+,-
###-sun-com" ()),-
[9] Ric&ar% Monson-3aeel- (ntreprise &a-a7eans ,th (dition- 1;Reilly" ()),-
/(

You might also like