Programming Java 2 Micro Edition for Symbian OS 2004 (779882), страница 78
Текст из файла (страница 78)
Some paths, therefore, needto be set. Assuming the J2ME Wireless Toolkit 2.1 has been installed toC:\WTK21 we should set the development platform’s PATH environmentvariable to that directory. On a Windows desktop computer, the path tothe binaries should be set as follows:C:> SET PATH=%PATH%;<install dir>\WTK21\binWe will also need a Java compiler.
We should already have the latestJ2SE SDK installed on the machine, so we can use that compiler. SetPATH as follows:C:> SET PATH=%PATH%;<install dir>\JavaSoft\j2sdk1.4.2\binNow we should be able to use both the compiler and pre-verifier quiteeasily. However, before we proceed we should also add a couple ofenvironment variables to make MIDlet creation a little easier. We need todirect the commands towards the MIDP API and the other J2ME classes.Therefore we should set the following variables:C:> SET J2MEHOME=<install dir>\WTK21C:> SET MIDPAPI=%J2MEHOME%\lib\midpapi20.jarC:> SET J2MECLASSPATH=%J2MEHOME%\wtklib\kenv.zip;%J2MEHOME%\wtklib\kvem.jar;%J2MEHOME%\wtklib\lime.jar;%J2MEHOME%\lib\cldcapi10.jarProgramming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2.0.
Martin de Jode 2004 Symbian Ltd ISBN: 0-470-09223-8438USING THE WIRELESS TOOLKIT TOOLS AT THE COMMAND LINENow that some handy variables have been set, we can try to createa MIDlet suite. Once the classes have been written, they need to becompiled. The following command should be used to compile all theclasses in the current directory and then put them in a previously createddirectory, tmpclasses. Note that we have specified the classpath of theMIDP API to make sure the compiler knows to compile against the CLDCand MIDP classes, otherwise the classes may be compiled against theJ2SE SDK.C:\WTK20\apps\Example\src>javac -d tmpclasses -bootclasspath %MIDPAPI%-classpath %J2MECLASSPATH% *.javaOnce this has been completed, all the compiled class files can beseen in the tmpclasses directory.
We should now pre-verify them. Bytyping the word preverify at the command line the following helpinformation appears showing the options available.Usage: preverify [options] classnames|dirnames ...where options include:-classpath<directories separated by ';'> Directories in which to lookfor classes-d <directory> Directory in which output is written (default is./output/)-cldcChecks for existence of language features prohibited byCLDC (native methods, floating point and finalizers)-nofinalizeNo finalizers allowed-nonativeNo native methods allowed-nofpNo floating point operations allowed@<filename>Read command line arguments from a text file Command linearguments must all be on a single line; directory names must be enclosed indouble quotes(")There are two options of interest to us here.
The -classpath option,which will specify which target API should be verified against, and the -doption, which specifies the output directory for these verified files. Thefollowing command should be issued in the current directory:C:\WTK20\apps\Example\src > preverify -classpath %MIDPAPI%;tmpclasses-d classes tmpclassesThe pre-verified files will now be in the classes directory. Thesefiles are ready for packaging into a MIDlet suite.
For this we use the jarcommand:C:\WTK20\apps\Example\src> jar -cvf MyMidlet.jar classes/*In this case we have asked the jar command to create a JAR filecalled MyMidlet.jar from all the files stored in the directory structureunder classes/.Appendix 4Developer Resources and BibliographyDownload code for this book fromwww.symbian.com/books/pjso/pjso-source.htmlSymbianCorporateDeveloperwww.symbian.comwww.symbiandevnet.comSymbian LicenseesArimaBenQFujitsuLenovoLGElectronicsMotorolaNokiaPanasonicPsionSamsungSanyoSendoSiemensSony Ericssonwww.arima.com.twwww.benq.comwww.fujitsu.comwww.legendgrp.comwww.lge.comwww.motorola.comwww.nokia.comwww.panasonic.comwww.psion.comwww.samsung.comwww.sanyo.comwww.sendo.comwww.siemens.comwww.sonyericsson.comOnline Developer ResourcesMotorolahttp://idenphones.motorola.com/iden/developer/developer home.jspNokiawww.forum.nokia.comProgramming Java 2 Micro Edition on Symbian OS: A developer’s guide to MIDP 2.0.
Martin de Jode 2004 Symbian Ltd ISBN: 0-470-09223-8440DEVELOPER RESOURCES AND BIBLIOGRAPHYNTT DoCoMowww.nttdocomo.com/corebiz/imode/why/tech.htmlSendowww.sendo.com/devSiemenswww.siemens-mobile.com/developerSony Ericssonhttp//developer.sonyericsson.com andwww.sonyericsson.com/developerSun Microsystemshttp://java.sun.com/j2meUIQwww.uiq.com/developerTools manufacturersAppForgewww.appforge.comBorlandhttp://bdn.borland.comMetrowerkswww.metrowerks.com/MW/Develop/Wireless/Default.htmResources Mentioned in This Book and Additional MaterialChapter 1Java Community Process, JSR 30: CLDChttp://jcp.org/en/jsr/detail?id=30Chapter 2Antennahttp://antenna.sourceforge.netApache, Jakarta projecthttp://jakarta.apache.orgApache, Ant downloadhttp://ant.apache.org/srcdownload.cgiApache, Ant projecthttp://ant.apache.org/index.htmlBorland, Jbuilderwww.borland.com/products/downloads/download jbuilder.htmlEclipsewww.eclipse.orgRESOURCES MENTIONED IN THIS BOOK AND ADDITIONAL MATERIAL441Forum Nokiawww.forum.nokia.comjEditwww.jedit.orgProguardhttp://proguard.sourceforge.netRetrologic Systemswww.retrologic.comSony Ericsson Developer Network, P900 Emulator for theWireless Toolkithttp//developer.sonyericsson.comSun, J2ME Wireless Toolkit 2.1 Downloadhttp://java.sun.com/products/j2mewtoolkit/download-2 1.htmlSun, J2SE downloadshttp://java.sun.com/j2se/downloads.htmlSun ONE Studio 4www.sun.com/software/sundev/jde/studio me/index.htmlSymbian Developer Network, UIQ2.1 SDKwww.symbian.com/developer/sdks uiq21.aspXinox Software, Jcreatorwww.jcreator.comChapter 3Forum Nokia, Camera MIDlet: A Mobile Media API Examplehttp://ncsp.forum.nokia.com/cspForum Nokia, Known Issues in the Nokia 6600 MIDP 2.0Implementation Version 1.2,www.forum.nokia.comJava Community Process, JSR 30: CLDC 1.0 specificationhttp://jcp.org/en/jsr/detail?id=30Java Community Process, JSR 118: MIDP 2.0 specificationhttp://jcp.org/en/jsr/detail?id=118Java Community Process, JSR 120: Wireless Messaging API specificationhttp://jcp.org/en/jsr/detail?id=120Java Community Process, JSR 135: Mobile Media API specificationhttp://jcp.org/en/jsr/detail?id=135Java Community Process, JSR 139: CLDC 1.1 specificationhttp://jcp.org/en/jsr/detail?id=139Java Community Process, JSR 185: JTWI specificationhttp://jcp.org/en/jsr/detail?id=185Java Verified Program for J2MEwww.javaverified.comSony Ericsson, Developer Guidelines: Java MIDP 2.0 for P900/908Version R3Ahttp://developer.sonyericsson.com442DEVELOPER RESOURCES AND BIBLIOGRAPHYSun (2003) The CLDC HotSpot Implementation Virtual Machine,White Paperhttp://java.sun.comSymbian, Symbian on Javawww.symbian.com/technology/standard-java.htmlSymbian Phoneswww.symbian.com/phonesChapter 4Bluetooth SIG, Assigned numbers: Bluetooth basebandhttps://www.bluetooth.org/foundry/assignnumb/document/basebandBluetooth SIG, Specification of the Bluetooth System, Volume 1.www.bluetooth.comCasira Development System for Bluetoothwww.csr.comForum Nokia, Nokia Developer’s Suite for J2ME 2.0http://forum.nokia.comForum Nokia, Series 60 MIDP SDK 1.2.1 for Symbian OS, Nokia Editionhttp://forum.nokia.comForum Nokia (2003) Setting Up and Using the Bluetooth TestingEnvironment for Series 60 Platformhttp://forum.nokia.comHopkins, B.
and Anthony, R. (2003) Bluetooth for Java, Apress.Java Community Process, JSR 82: Java APIs for Bluetooth WirelessTechnologyhttp://jcp.org/en/jsr/detail?id=82Rococo Impronto Simulatorwww.rococosoft.comSymbian, UIQ 2.1 SDKwww.symbian.comChapter 5kXML libraryhttp://xmlpull.orgNokia, Wireless Toolkithttp://forum.nokia.comProguard Obfuscation Libraryhttp://proguard.sourceforge.netSony Ericsson Developer Network, P900 Emulator for the WirelessToolkithttp//developer.sonyericsson.comRESOURCES MENTIONED IN THIS BOOK AND ADDITIONAL MATERIAL443Sun, J2ME Wireless Toolkit 2.1 Downloadhttp://java.sun.com/products/j2mewtoolkit/download-2 1.htmlSun, Java Web Services Toolkithttp://java.sun.com/webservices/webservicespack.htmlChapter 6Java Community Process, JSR185: JTWI specificationhttp://jcp.org/en/jsr/detail?id=185W3, CC/PP informationwww.w3.org/Mobile/CCPPChapter 7Allin, J.
(2001) Wireless Java for Symbian Devices, Wiley.Buschmann, F., Meunier, R., Rohnert, H., Sommerland, P. and Stal, M.(1996) Pattern-Oriented Software Architecture: A system of patterns,Wiley.Embedded Microprocessor Benchmark Consortium, GrinderBenchwww.eembc.hotdesk.comGrand, M. and Knudsen, J. (1997) Java Fundamental Classes Reference,O’ReillyHaggar, P. (2000) Practical Java Programming Language Guide, AddisonWesley.Knuth, D.
E. (1997) The Art of Computer Programming Addison Wesley.Larman, C. and Guthrie, R. (1999) Java 2 Performance and Idiom Guide.Prentice Hall.Lurie, J. (2001) Develop a Generic Caching Service to Improve Performance, Java Worldwww.javaworld.com/javaworld/jw-07-2001/jw-0720cache p.htmlNondove, Amark 1.3http://amark.nondove.itPoundstone, W. (1985) The Recursive Universe: Cosmic complexity andthe limits of scientific knowledge, William Morrow.Proguardhttp://proguard.sourceforge.netShirazi, J. (2003) Java Performance Tuning, O’Reilly.Sosnoski, D.
M. (1999) Smart Object-management Saves the Daywww.javaworld.com/javaworld/jw-11-1999/jw-11performance.htmlChapter 8ARC Groupwww.arcgroup.com444DEVELOPER RESOURCES AND BIBLIOGRAPHYeWeek, Enterprise news and reviewswww.eweek.com/article2/0,4149,893492,00.aspJava Community Process, JSR 75: PDA Optional Packages for the J2MEPlatformhttp://jcp.org/en/jsr/detail?id=75Java Community Process, JSR 135: Mobile Media APIhttp://jcp.org/en/jsr/detail?id=135Java Community Process, JSR 172: J2METM Web Services Specificationhttp://jcp.org/en/jsr/detail?id=172Java Community Process, JSR 177: Security and Trust Services API forJ2MEhttp://jcp.org/en/jsr/detail?id=177Java Community Process, JSR 179: Location API for J2MEhttp://jcp.org/en/jsr/detail?id=179Java Community Process, JSR 180: SIP API for J2MEhttp://jcp.org/en/jsr/detail?id=180Java Community Process, JSR 184: Mobile 3D Graphics API for J2MEhttp://jcp.org/en/jsr/detail?id=184Java Community Process, JSR 205: Wireless Messaging API 2.0http://jcp.org/en/jsr/detail?id=205Java Community Process, JSR 211: Content Handler APIhttp://jcp.org/en/jsr/detail?id=211Java Community Process, JSR 226: Scalable 2D Vector Graphics API forJ2MEhttp://jcp.org/en/jsr/detail?id=226Java Community Process, JSR 229: Payment APIhttp://jcp.org/en/jsr/detail?id=229Java Community Process, JSR 230: Data Sync APIhttp://jcp.org/en/jsr/detail?id=230Java Community Process, JSR 232: Mobile Operational Managementhttp://jcp.org/en/jsr/detail?id=232Java Verified Programwww.javaverified.comKhronos Group, OpenGL ESwww.khronos.org/openglesMacrospacewww.macrospace.comO’Doherty, P.