基于全球卫星定位系统GPS的软件开发Word下载.docx
- 文档编号:22000555
- 上传时间:2023-02-02
- 格式:DOCX
- 页数:16
- 大小:91.72KB
基于全球卫星定位系统GPS的软件开发Word下载.docx
《基于全球卫星定位系统GPS的软件开发Word下载.docx》由会员分享,可在线阅读,更多相关《基于全球卫星定位系统GPS的软件开发Word下载.docx(16页珍藏版)》请在冰豆网上搜索。
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<
toolkit>
/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:
<
mime-mapping>
<
extension>
jad<
/extension>
mime-type>
text/vnd.sun.j2me.app-descriptor<
/mime-type>
/mime-mapping>
jar<
application/java-archive<
ChangeyourJADfile'
sMIDlet-Jar-URLpropertytospecifytheURLofyourJARfile.Forexample,inthecopyofgames.jadyouuploadedtotheserver,change...
MIDlet-Jar-URL:
games.jar
...to...
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:
html>
head>
title>
Midlets<
/title>
/head>
body>
Downloadmidlets:
p>
ahref="
http:
//127.0.0.1:
8080/games.jad"
>
Games.jad<
/a>
/mobility/midp/articles/deploy/calc.jad"
Calc.jad<
/mobility/midp/articles/deploy/browser.jad"
Browser.jad<
Thankyou.
/body>
/html>
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
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 全球卫星 定位 系统 GPS 软件 开发
![提示](https://static.bdocx.com/images/bang_tan.gif)