基于全球卫星定位系统GPS的软件开发.docx
《基于全球卫星定位系统GPS的软件开发.docx》由会员分享,可在线阅读,更多相关《基于全球卫星定位系统GPS的软件开发.docx(16页珍藏版)》请在冰豆网上搜索。
![基于全球卫星定位系统GPS的软件开发.docx](https://file1.bdocx.com/fileroot1/2023-2/1/7d4e1c02-c9bb-4506-9875-35f8d526e2e4/7d4e1c02-c9bb-4506-9875-35f8d526e2e41.gif)
基于全球卫星定位系统GPS的软件开发
本科生毕业设计(论文)英文翻译
毕业设计题目:
基于全球卫星定位系统GPS的软件开发
学院:
专业班级:
学生姓名:
指导教师:
2008年4月7日
DeployingWirelessJavaApplications
byQusayH.Mahmoud
October2002
Developersusuallybuild,test,andevaluateanapplicationonaplatformsimilartotheoneonwhichitwillbedeployedandrun.DevelopmentofwirelessJavaapplicationsismorechallengingbecausetheytypicallyaredevelopedononeplatform(suchasSolarisorMSWindows)butdeployedonatotallydifferentone(suchasacellphoneorPDA).Oneconsequenceisthat,whileemulatorsenabledeveloperstodosomeoftheirtestingonthedevelopmentplatform,ultimatelytheymusttestandevaluatetheapplicationintheverydifferentenvironmentofalivewirelessnetwork.
TheaimofthisarticleistoshowyouthedifferentwaysyoucandownloadlocalandnetworkapplicationstoJ2ME-enableddevices,forbothtestingandfinaldeployment.AfterabriefreviewofwirelessJavaapplicationsandtheirdevelopmentlife-cycle,thearticleshowsyouhowto:
Deploywirelessapplicationsremotely
Downloadlocalandremotelydeployedapplications
Downloadapplicationsovertheair
WirelessJavaApplications
WirelessJavaapplicationsfallintotwobroadcategories:
Localapplications(alsocalledstand-aloneapplications)performalltheiroperationsonahandheldwirelessdeviceandneednoaccesstoexternaldatasourcesthroughawirelessnetwork.Examplesincludecalculatorsandsingle-playergames.
Networkapplicationsconsistofsomecomponentsrunningonawirelessdeviceandothersrunningonanetwork,andthusdependonaccesstoexternalresources.Anexamplewouldbeanemailapplication,withaclientresidingonawirelessphonethatinteractswithaSimpleMailTransferProtocol(SMTP)servertosendmessages.
Althoughthesetwotypesofapplicationsaredifferent,theyaredeployedinthesameway.Thebigdifferenceshowsuplater:
Localapplicationsareeasiertotestthannetworkapplications.Forexample,acalculatorapplicationcanrunonawirelessphoneevenwhenitisnotconnectedtoanynetwork,butanemailclientwon'tworkwithoutaconnectiontotheSMTPserverthatactuallytransmitsthemessages.
WirelessJavaApplicationsDevelopmentLifecycle
Thedevelopmentlife-cycleofMIDletsandotherwirelessJavaapplicationscomprisesthreesteps:
Writetheapplication.Useyourfavoritewirelessapplicationdevelopmentenvironmentandtoolstodeveloptheapplication.MyfavoriteistheJ2MEWirelessToolkit.Ithasasimpleandintuitiveuserinterfacethatmakesiteasytostartdevelopingwirelessapplications.Moreimportantly,itincludesseveralemulatorsfortestingyourapplications.(Someofwhatfollowswillassumeyouusethistoolkittoo.Ifyouuseanotherdevelopmentenvironment,you'llhavetoadaptwhatyoureadheretothatenvironment.)
Testtheapplicationinanemulationenvironment.Oncetheapplicationcompilesnicely,thebestplacetobegintestingitisanemulator.TheJ2MEWirelessToolkitcomeswithseveral,includingMotorolai85s,PalmOSdevice,andRIMBlackberry.Itisimportanttonote,however,thattheseemulatorsdonotsimulateperfectlyallofthefeaturesofthecorrespondingdevices.Theyaremerelyskinswiththeappropriatedimensions,sothefollowingstepiscrucial.
Downloadtheapplicationtoaphysicaldeviceandtestit.Onceyouarehappywiththeapplication'sperformanceononeormoreemulators,downloadittoarealdeviceandtestitthere.Ifit'sanetworkapplication,testitonalivewirelessnetworktoensurethatitsperformanceisacceptable.
Thisarticle'sfocusisonthatlaststep:
deployingandtestingtheapplicationonaphysicaldevice.
DeployingandRunningRemoteApplications
TheJ2MEWirelessToolkitenablesyoutorunyourlocalwirelessapplicationfromwithinthedevelopmentenvironment;theJADandJARfilesareavailableonyourownsystem(ifyou'reusingtheJ2MEWirelessToolkit,in/apps/YourProject/bin).Ifyouwishtomarketyourwirelessapplications,however,youneedtodeploythemwhereusersfromallovertheworldcanaccessthem.
RemoteDeployment
Todeployyourwirelessapplicationsremotely:
Uploadyourapplicationfiles(JADandJAR)toaremotewebserver.Ifyourprojectisnamedgames,forinstance,uploadthefiles:
games.jadandgames.jarfromthebindirectoryofyourprojecthome(forexample,/apps/games/bin).Notethatthetwofilesmustendupinthesamedirectoryontheserver.
ReconfigurethewebserversothatitrecognizesJADandJARfiles:
FortheJADfiletype,setthefileextensionto.jadandtheMIMEtypetotext/vnd.sun.j2me.app-descriptor.
FortheJARfiletype,setthefileextensionto.jarandtheMIMEtypetoapplication/java-archive.
Howyouconfigurethewebserverdependsonwhichoneyou'reusing.Forexample,ifyou'reusingTomcat,makesureyourweb.xmlfileincludesthefollowinglines:
jad
text/vnd.sun.j2me.app-descriptor
jar
application/java-archive
ChangeyourJADfile'sMIDlet-Jar-URLpropertytospecifytheURLofyourJARfile.Forexample,inthecopyofgames.jadyouuploadedtotheserver,change...
MIDlet-Jar-URL:
games.jar
...to...
MIDlet-Jar-URL:
http:
//YourWebServerAddress:
port/pathTo/games.jar
RunningRemotelyDeployedApplications
Toseewhetheryourapplicationdeployedcorrectly,openanordinarywebbrowserandentertheJADfile'sURL.TheJ2MEWirelessToolkit'sdefaultemulatorshouldappearandtheremotelydeployedapplicationshouldruninit.
J2ME-enableddevices(theMotorola/Nexteli85s,forexample)includeaJavaApplicationManager(JAM)responsiblefordownloading,installing,andconfiguringapplications.TheJ2MEWirelessToolkitincludesasampleJAMyoucanruninthedefaultemulator.Toseehowtheuserwilldownloadandmanageyourapplication,openacommandprompt,changethecurrentdirectoryto/bin,andenterthecommand:
emulator-Xjam
TheemulatorappearsandyouseetheJAM'smainscreen.Inversion1.0.4ofthetoolkit,themainscreenlookslikethis:
Figure1:
TheJ2MEWirelessToolkitJavaApplicationManager'sMainScreen
SelecttheInstallsoftbuttonandyouwillbepromptedfortheapplication'sURL,asshowninFigure2.EntertheURLofawebpagethatcontainsahyperlinktotheapplication'sJADfile.
Figure2:
EnteringtheURLfortheApplication'sJADFile
EnteringalongURLintoawirelessphoneisinconvenient.Afasterandeasierwaytogetstartedistouseacommandinthisform:
emulator-Xjam:
install=http:
//yourWebServerAddress:
port/yourApp.jad
Withoutfurtherentry,theJAMdownloadstheJARfilespecifiedintheJADfileandinstallstheapplication.Thenexttimeyoustarttheemulator,simplyselecttheJAM'sMenubutton,thenusethemenutoruntheapplication,removeit,orperformtheotherfunctionsshowninFigure3:
Figure3:
TheJAM'sMainMenu
ItisimportanttonotethatthissyntaxallowsyoutoinstallonlyoneMIDletatatime.EnteringaURLallowsyoutoviewawebpagethatmaycontainseveralMIDletsyoucanchoosefrom.Asanexample,considerthefollowingHTMLfile(midlets.html)thatcontainslinkstothreeJADfiles:
MidletsDownloadmidlets:
//127.0.0.1:
8080/games.jad">Games.jad
Calc.jad
Browser.jad
Thankyou.
tisimportanttonotethatthehyperlinkspointtotheapplication'sJADfile.Now,entertheURLintotheinstallwindowasshowninFigure4.(TheIPaddress127.0.0.1isequivalenttolocalhost.)
Figure4:
EnteringaURLintheInstallWindow
TheJAMreadstheHTMLdoccument(midlets.html),parsesthehyperlinks,anddisplaysalistofMIDletsyoucandownload:
Figure5:
LinkstoDownloadableMIDlets
NowyoucanselectaMIDlettodownload.TheJAMreadstheJADfiletodiscoverwhetherthedeviceiscapableofhandlingtheapplication.Ifso,itdownloadsandinstallstheJARfilespecifiedintheJADfile.OncethegamesMIDletisdownloadedandinstalled,youwillseeadisplaysimilartoFigure6.Notethatgames.jadistheMIDletsuitethatcomeswiththeJ2MEWirelessToolkit
Figure6:
TheMIDletSuiteofGamesDownloadedandInstalled
TheJAMissmartenoughtonotifyyouifyoutrytoinstallaMIDletthat'salreadyonyourdevice,asinFIgure7.Itwill,however,allowyoutodownloadanupdatedversionoftheMIDlet.
Figure7:
WarningThatMIDletIsAlreadyInstalled
DeployingandRunningApplicationsonPhysicalDevices
Deployingandrunningapplicationsinanemulationenvironmentisaverygoodwaytotestthelogicandflowofyourapplicationgenerally,butyouwon'tbecertainitwillsatisfyusersuntilyoutestitonarealphysicaldeviceconnectedtoawirelessnetwork.Yourapplication'sperformancemaybestunningintheemulator,whichhasalltheprocessingpowerandmemoryofyourdesktopmachineatitscommand,butwillitperformwellonthehandhelddevice,withitslimitedmemoryandprocessingpower,lowbandwidth,andotherconstraints?
ToperformrealistictestsyouneedaJ2ME-enabledphysicaldevice,andadatacabletoconnectittoyourdesktop.Forthisarticle.
IusedaMotorola/Nexteli85scellphone,availablefromNextel,whichoffersseveralmodelsandrateplans.
DeployingLocalApplications
IfyouhaveaMotorolaJ2ME-enabledphone,youcandownloadstand-aloneapplicationsusingtheMotorolaJavaApplicationLoa