Programming Java 2 Micro Edition for Symbian OS 2004 (779882), страница 17
Текст из файла (страница 17)
We shall, therefore, walk through thenecessary steps required to integrate the product with Borland’s JBuilder9 Personal Edition. (Note that the NDS can also be integrated with SunONE Studio 4, Mobile Edition.)The Nokia Developer’s Suite requires JBuilder 9 and the Mobile Set3.01 to be installed first. We will outline the installation of them inSection 2.3.2.1.The steps to install the NDS on Windows are as follows:1.
Download the ZIP file from the Forum Nokia website and extract itto a suitable location.2. To register the software and obtain a serial number for installation,you must have a valid registration with Forum Nokia. The serialnumber will be sent to the registered email address. Request theregistration key and click either ‘‘sent’’ or ‘‘already supplied’’ on thedialog box.3. Execute the file setup.exe in the extraction directory. After thesplash screen, the terms and conditions of use have to be agreed to.A prompt then appears requesting the entry of the serial number forthe software (Figure 2.12).Figure 2.12NDS installation.66GETTING STARTEDFigure 2.13 Choosing configuration type.4.Once the serial number has been entered, the next decision to bemade is how you will actually install the suite, integrated either withJBuilder or Sun ONE Studio, or as a Standalone tool (Figure 2.13).5.The locations of the JBuilder IDE need to be confirmed along withthe destination of the NDS, in successive dialog boxes.6.The installation is now ready to begin.
Press ”Install” to installthe software. Once the installation has completed, the PC willrequire restarting.The NDS has now been fully integrated with the JBuilder IDE. Go tothe Tools menu within the Borland IDE and see that ”Nokia DevelopersSuite for J2ME” has appeared near the bottom.2.3.2 Integrated Development Environments2.3.2.1 JBuilder 9OverviewBorland has created a number of tools for the developer, with varyingdegrees of functionality, ranging from the basic personal edition throughto enterprise level.The IDE provides a thorough interface for creating Java applications.The text editor provides auto-completion of methods and class members.It also provides a graphical overview of all the methods and class membersINTRODUCTION TO TOOLS FOR MIDP67in the currently displayed class.
Classes can be navigated and viewedeasily using the Project and Structure windows.Compilation highlights where errors have occurred and, by simplydouble-clicking the message, the user will be taken to the error. Librariesand other APIs can be easily imported and added to projects, negating theneed to worry about classpaths on the PC itself. Version 9 also includesteam collaboration utilities with version control software such as CVS.As each new edition of the IDE is released, the previous one is available from the Borland website for non-commercial evaluation purposes(www.borland.com/products/downloads/download jbuilder.html). ThePersonal version can be found here and, of course, can only be used fornon-commercial evaluation purposes.Borland also provides an additional module, the Mobile Set, whichextends the IDE into mobile development, providing the functionalityof the WTK.
The Borland Mobile Set 3.01 has been created essentiallyto enable the JBuilder IDE to also be a wireless development tool. Itintegrates with the Wireless Toolkit and provides visual design tools forthe creation of MIDlets. It can also provide support for the NDS andother manufacturer add-ins, and the Mobile Set includes support for OTAprovisioning. JBuilder 9 also provides support for the unified emulatorinterface (UEI), which is described in greater detail later in this chapter.JBuilder 9 supports class obfuscation, using RetroGuard version 1.1.
Thisprocess occurs as part of the archive process and reduces the final size ofthe JAR files. The process of obfuscation reduces class file sizes when itscrambles the source code. The Mobile Set also uses RetroGuard.RetroGuard rolls the creation of JAD and JAR files into a more accessible interface as well as giving developers debugging capabilities andtesting of applications on device emulators. It is available under the GNULesser General Public License from www.retrologic.com.InstallationWe will now give an overview of how to install JBuilder 9 Personal EditionIDE. A non-commercial Personal edition of each version of JBuilder ismade available for evaluation purposes.
The latest version is calledJBuilderX and includes support for MIDP 2.0 application development.First, download two installation files (jb9_windows.zip andmobileset_301.zip) from the Borland website: www.borland.com/products/downloads/download jbuilder.html. A valid registrationand email address will be required to successfully complete theinstallation.1. Extract both ZIP files to a suitable location. The JBuilder ZIP will produce a file called per_install.exe. This file should be executed.2. After the Borland splash appears, the destination for the tool will berequested (see Figure 2.14). When this has been entered press Next.68GETTING STARTEDFigure 2.14 JBuilder installation.3.Once installation is complete, the product needs to be registered withthe vendor. A license activation file is sent automatically to the registered email address. This should be saved to an appropriate location.4.Enter the location of the activation file (Figure 2.15).5.Once the activation location has been given, the IDE is now readyfor use.
However, the IDE is not quite ready for J2ME development.We need to also install the Mobile Set to give the option of workingwith J2ME capabilities as well as J2SE.6.Execute mobileset.exe to commence installation. A prompt willappear to determine the installation type. The Full Install option alsoinstalls the RetroGuard obfuscator.7.After setting the destination for the tool, installation should continuewithout further prompting.2.3.2.2 Metrowerks CodeWarrior Wireless Studio 7OverviewCodeWarrior is a commonly-used IDE that provides the developer withall the tools required for MIDP application creation.
A new version of thetool is on its way, and it will integrate Java with native C++ development.The Wireless Development Toolkit has been integrated into the IDE.This means the default emulators are present. Device emulators such asINTRODUCTION TO TOOLS FOR MIDP69Figure 2.15 Registering the tool.that for the Sony Ericsson P800 can, however, also be added to the IDE.Consequently, the packaging, pre-verification, compilation, and testingcan all be carried out within one user interface.
JAD files are also createdautomatically for the developer, while WYSIWYG drag and drop RADtools supporting MIDP are also present.CodeWarrior offers code obfuscation, just as JBuilder does. This isuseful for two reasons. It provides a level of protection against piratingof software by mangling the source code; if the application is everdecompiled, the results will, hopefully, be confusing enough to preventthe code from being stolen. Obfuscation also provides shortened namingconventions within the output code. This is a known method for creatingmore efficient MIDP applications and will speed up performance.Project management and team development are supported by version control and integrated management of targets, classes and sourcecode.
Remote debugging can also be carried out on JDWP-compliantvirtual machines.InstallationMetrowerks does not at present provide an online evaluation version ofthe software. This document will therefore give a brief overview of theinstallation of the full Professional Wireless Edition.70GETTING STARTEDThe minimum system requirements are as follows:• Windows 98/2000/ME/NT 4.0 with Service Pack 4 or later• Sun’s Java SDK, v1.2 or later (JSDK 1.3.1 and JSDK 1.4.0 included)• Pentium class or AMD-K6 class processor• 64 MB RAM• 250 MB hard disk space• CD-ROM drive for installation• an Internet connection for registration.To install the IDE:1.Insert the CodeWarrior CD-ROM.
It should automatically displaythe setup menu. If it does not, locate and run Launch.exe. Theuser is welcomed to the installation process and warned that theinstallation process is about to begin.2.A dialog asks the user to accept the licensing conditions andprovides a brief introduction to the product.3.The user is asked to specify the destination for the installation(Figure 2.16).Figure 2.16CodeWarrior installation.INTRODUCTION TO TOOLS FOR MIDP714.The user is asked to name the shortcut for later use.5.The user is given the chance to make file associations between theIDE and, amongst others, Java source files.6.A summary of the installation information is displayed for confirmation.
Upon acceptance, the installation process begins.7.During this process, the option of installing PersonalJava is presented. If this is required, a separate installation process will be runbefore the CodeWarrior installation continues.8.Next, the installation of the J2ME Wireless Toolkit is required. If thisalready resides on the PC this can be ignored. Otherwise proceedwith its installation.9.Select the Stand Alone installation type when prompted.10.At the end of the process, the user will be asked if they wish tosearch for any updates and patches to the IDE software.11.The registration process then needs to be followed (see Figure 2.17).Registration details are sent to Metrowerks and a temporary licenseis granted until the license request has been validated.
An Internetconnection is required for this. The permanent license will be sentvia email and the instructions within the readme.txt file shouldbe followed.12.The user will be prompted to restart the PC. Make sure all necessaryfiles are saved at this point.Figure 2.17Registering CodeWarrior.72GETTING STARTED2.3.2.3 Sun ONE Studio 4, Mobile EditionOverviewSun ONE Studio 4 is widely used within the Java developer community.This IDE gives the developer all the usual source file editing, packaging,pre-verification and compilation processes.