Page 3 - Contents; Preface
Contents iii Contents Preface ix 1. Introduction 1 1.1 Quick Start 1 1.2 The Tools in the Toolkit 2 1.3 Toolkit Features 3 1.4 Supported Technology 3 2. Developing MIDlet Suites 5 2.1 About Projects 5 2.2 The Simple Development Cycle 7 2.2.1 Edit Source Code 7 2.2.2 Build 8 2.2.3 Run 9 2.3 The Full ...
Page 4 - Using the Emulator
iv J2ME Wireless Toolkit User’s Guide • October 2004 3.1 Selecting APIs 19 3.2 Changing MIDlet Suite Attributes 21 3.3 Manipulating MIDlets 23 3.4 Using the Push Registry 24 3.5 Project Directory Structure 25 3.6 Using Third-Party Libraries 25 3.6.1 Third-Party Libraries for One Project 26 3.6.2 Thi...
Page 5 - Security and MIDlet Signing
Contents v 5.3.1 Filtering Messages 45 5.3.2 Sorting Messages 46 5.3.3 Saving and Loading Network Monitor Information 46 5.3.4 Clearing the Message Tree 47 6. Security and MIDlet Signing 49 6.1 Permissions 49 6.2 Protection Domains 50 6.3 Signing a MIDlet Suite 51 6.4 Managing Keys 52 6.4.1 Creating...
Page 6 - Working With Mobile 3D Graphics; FileConnection; Using the Bluetooth and OBEX APIs
vi J2ME Wireless Toolkit User’s Guide • October 2004 8.4 Well-Behaved MIDlets 66 9. Working With Mobile 3D Graphics 67 9.1 JSR 184 Overview 67 9.2 Immediate Mode 67 9.3 Retained Mode 68 9.4 Trading Quality for Speed 68 9.5 Creating Mobile 3D Graphics Content 69 10. Using the PIM and FileConnection A...
Page 7 - B. Command Line Reference
Contents vii A.6.1 Simple Tones 87 A.6.2 Simple Player 87 A.6.3 PausingAudioTest 89 A.6.4 Video 89 A.6.5 Attributes for mmademo 90 A.7 ObexDemo 90 A.8 PDAPDemo 92 A.8.1 Browsing Files 92 A.8.2 The PIM API 94 A.9 WMADemo 97 B. Command Line Reference 103 B.1 Prerequisites 103 B.2 The Development Cycle...
Page 8 - Font Support in the Default Emulator; Index
viii J2ME Wireless Toolkit User’s Guide • October 2004 C.4 Font Support in the Default Emulator 117 Index 119
Page 9 - Who Should Use This Book; Related Documentation
Preface ix Preface This document describes how to work with the J2ME Wireless Toolkit. Who Should Use This Book This guide is intended for developers creating Mobile Information Device Profile(MIDP) applications with the J2ME Wireless Toolkit. You should alreadyunderstand how to use, the Mobile Info...
Page 10 - How This Book Is Organized
x J2ME Wireless Toolkit User’s Guide • October 2004 http://developers.sun.com/techtopics/mobility/ How This Book Is Organized This guide contains the following chapters and appendixes: Chapter 1 introduces the J2ME Wireless Toolkit and the development features it provides. Chapter 2 describes the de...
Page 12 - Typographic Conventions
xii J2ME Wireless Toolkit User’s Guide • October 2004 Typographic Conventions Accessing Documentation Online The following sites provide technical documentation related to Java technology. http://developer.sun.com/ http://java.sun.com/docs/ We Welcome Your Comments We are interested in improving our...
Page 13 - Introduction; Quick Start
1 C H A P T E R 1 Introduction This book describes how to use the J2ME Wireless Toolkit. The J2ME Wireless Toolkit is a set of tools that makes it possible to createapplications for mobile phones and other wireless devices. Although it is based onthe Mobile Information Device Profile (MIDP) 2.0, the...
Page 14 - Open Project; The Tools in the Toolkit
2 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 1 The KToolbar window Next, click on the Open Project... button to open a demonstration application. You'll see a list of all the available applications. Pick one of them and click on the Open Project button in the dialog. Once the applicati...
Page 15 - Toolkit Features; Building and packaging; Running and monitoring; MIDlet suite signing; Supported Technology
Chapter 1 Introduction 3 KToolbar is the center of the toolkit. You can use it to build applications, launch theemulator, and start the utilities. Alternately, the emulator and utilities can be runby themselves, which is useful in many situations. If you want to demonstrateMIDP applications, for exa...
Page 17 - Developing MIDlet Suites; About Projects
5 C H A P T E R 2 Developing MIDlet Suites This chapter describes how you can use the J2ME Wireless Toolkit to createapplications. It begins with a description of toolkit projects, then works through thedevelopment process. There are two basic development cycles you are likely to follow in creating ...
Page 18 - Create Project; OK
6 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 2 The KToolbar window Click on New Project... The toolkit will ask you for the name of the project and the name of the MIDlet class you will write. Fill in the names and click Create Project . FIGURE 3 Creating a new project The project opti...
Page 19 - The Simple Development Cycle; Edit source code; Edit Source Code
Chapter 2 Developing MIDlet Suites 7 FIGURE 4 File locations in the console 2.2 The Simple Development Cycle The simple development cycle looks like this: Edit source code → Build → Run 1. Edit source code . In this step, you create Java source files and resource files that will be used by your appl...
Page 20 - Build
8 J2ME Wireless Toolkit User’s Guide • October 2004 If you are following along with the example project, create a new Java source file TinyMIDlet.java . It should be saved in the source directory of your project, which will be {toolkit} \apps\Tiny\src\TinyMIDlet.java where {toolkit} is the installat...
Page 21 - Run
Chapter 2 Developing MIDlet Suites 9 FIGURE 5 Messages about building Behind the scenes, the J2ME Wireless Toolkit also preverifies the compiled classfiles. MIDlet class files must be preverified before they can be run on a MIDPdevice or emulator. The toolkit quietly handles this detail for you; you...
Page 22 - Launch
10 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 6 List of project MIDlets Choose the MIDlet you want and select Launch . If you’re following along with the TinyMIDlet example, you’ll see the fruit of your labors: FIGURE 7 TinyMIDlet in action
Page 23 - The Full Development Cycle; Package
Chapter 2 Developing MIDlet Suites 11 2.3 The Full Development Cycle The second development cycle is slightly more complicated: Edit source code → Package → Install → Run 1. Edit source code . This is the same as in the simple cycle. 2. Package . In this step, the J2ME Wireless Toolkit compiles and ...
Page 24 - Project > Run via OTA; Apps; Install
12 J2ME Wireless Toolkit User’s Guide • October 2004 2.3.2 Install To properly test a MIDlet suite, you should install it into the toolkit’s emulator or areal device. When you press the Run button in KToolbar, the MIDlet suite is not installed into the emulator. Instead, the emulator runs the MIDlet...
Page 25 - Go
Chapter 2 Developing MIDlet Suites 13 FIGURE 9 URL prompt Choose Go from the menu to begin the installation. The emulator shows a list of the applications it finds at the URL. Choose the only one and select Install from the menu. The emulator gives you one last chance to confirm your intentions. FIG...
Page 26 - Run via OTA
14 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 11 The application menu, again Run via OTA is an extremely useful mechanism that makes it easy to install your MIDlet suite on the toolkit emulator. Some features must be tested using this technique, including the push registry and the inst...
Page 27 - Using an Obfuscator
Chapter 2 Developing MIDlet Suites 15 FIGURE 12 Launching the installed application Running an application on a real device depends heavily on the device itself.Consult your device documentation for information. 2.4 Using an Obfuscator An obfuscator is a tool that reduces the size of class files. MI...
Page 28 - Obfuscated Package
16 J2ME Wireless Toolkit User’s Guide • October 2004 3. Uncompress the proguard.jar file from the lib directory of the ProGuard installation to the bin directory of your J2ME Wireless Toolkit installation. Once ProGuard is installed, you can use it by choosing Project > Package > Create Obfusc...
Page 29 - Using a Debugger; Debug
Chapter 2 Developing MIDlet Suites 17 2.5 Using a Debugger A variation on running your application is running it with a debugger. A debuggerallows you to monitor the running application more closely, set breakpoints, andexamine variables. You will need to supply your own debugger. You can use the jd...
Page 31 - Working With Projects; Selecting APIs; API Selection
19 C H A P T E R 3 Working With Projects In the last chapter, you learned how the J2ME Wireless Toolkit helps you with theMIDP development cycle. This chapter delves more deeply into the details ofworking with projects, including the following: ■ Selecting the target APIs for a project ■ Manipulatin...
Page 32 - JTWI; Note –
20 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 13 The project settings window On the API Selection tab, the Target Platform setting controls the appearance of the rest of the tab. Choose the setting that best suits your need, and tweak yourselection with the controls below. For example,...
Page 33 - Changing MIDlet Suite Attributes; Required
Chapter 3 Working With Projects 21 3.2 Changing MIDlet Suite Attributes The project settings window also allows you to control the MIDlet suite attributes,which are stored in the descriptor as well as the manifest file of the MIDlet suiteJAR. To see the attributes, run KToolbar and open a project. T...
Page 34 - User Defined; Remove
22 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 14 Editing MIDlet suite attributes To create new user-defined attributes, click on the User Defined tab. Press Add and fill in the key name. You can then edit the attribute value by clicking in the valuecolumn next to the key, just as you w...
Page 35 - Manipulating MIDlets; MIDlets; Add
Chapter 3 Working With Projects 23 3.3 Manipulating MIDlets The project settings also provide a way to add or modify the MIDlets that arecontained in the current MIDlet suite project. To see how this works, start KToolbarand open an existing project. Click on Settings... and choose the MIDlets tab. ...
Page 36 - Using the Push Registry
24 J2ME Wireless Toolkit User’s Guide • October 2004 The MIDlet names are presented to the user in the order shown when the MIDletsuite is launched. You can modify the order by selecting a MIDlet and clicking Move Up or Move Down . 3.4 Using the Push Registry You can also use project settings to wor...
Page 37 - Project Directory Structure; Using Third-Party Libraries
Chapter 3 Working With Projects 25 If you do make push registry entries for your application, make sure you also enterthe appropriate permissions. See Chapter 6, “Security and MIDlet Signing ,” for details. 3.5 Project Directory Structure Projects have a standard directory structure. The project its...
Page 38 - Third-Party Libraries for One Project; Third-Party Libraries for All Projects; Configuring KToolbar
26 J2ME Wireless Toolkit User’s Guide • October 2004 When you use a third-party library in your application, your JAR will expand bythe size of the third-party library. You can use an obfuscator to reduce the codesize, and a good obfuscator will even eliminate whatever parts of the library youare no...
Page 39 - Setting the Application Directory; Working with Revision Control Systems
Chapter 3 Working With Projects 27 3.7.1 Setting the Application Directory By default, the J2ME Wireless Toolkit stores applications in directories under {toolkit} \apps . You can change this by adding a line to ktools.properties of the following form: kvem.apps.dir: <application_directory> An...
Page 41 - Using the Emulator; Emulator Skins
29 C H A P T E R 4 Using the Emulator The J2ME Wireless Toolkit emulator simulates a MIDP device on your desktopcomputer. It is a convenient way to see how your application performs in a MIDPenvironment and gives you a tight development cycle that is entirely contained onyour desktop computer. The e...
Page 44 - Setting Emulator Preferences; Network Proxies; Network
32 J2ME Wireless Toolkit User’s Guide • October 2004 You can use the mouse to click on the buttons to press them. Most buttons alsohave keyboard shortcuts, which are generally easier to use. Keyboard numbers 0through 9 correspond to the emulator ’s 0 through 9 buttons. Some less obviouskeyboard shor...
Page 45 - Heap Size; Storage; Storage and Cleaning
Chapter 4 Using the Emulator 33 4.3.2 Heap Size The heap is memory where your application’s objects are stored. Many real devices have limited heap size. You can set a maximum heap size to more closely simulatethe conditions on a real device. Choose Edit > Preferences... from the KToolbar menu an...
Page 46 - Adjusting Emulator Performance; Performance
34 J2ME Wireless Toolkit User’s Guide • October 2004 The toolkit enables you to choose a different location for the storage files, and youcan limit the size of the storage. This is useful if you wish to test your application’sbehavior when a small amount of persistent storage is available. To adjust...
Page 47 - Pausing and Resuming
Chapter 4 Using the Emulator 35 FIGURE 19 Adjusting the emulator ’s performance Adjust the Graphics primitives latency to have an effect on the amount of time that elapses between your application’s calls to drawing methods in the Graphics class and when the drawing actually takes place. To change t...
Page 48 - Running the Emulator Solo; Using Third Party Emulators
36 J2ME Wireless Toolkit User’s Guide • October 2004 When the emulator is running, choose MIDlet > Pause from the emulator window’s menu. The running MIDlet is paused and the screen displays an“Incoming Call...” message. To resume the MIDlet’s operation, choose MIDlet > Resume from the menu. 4...
Page 51 - Monitoring Applications; Using the Profiler; Monitor
39 C H A P T E R 5 Monitoring Applications The J2ME Wireless Toolkit provides several tools to monitor the behavior of yourapplications. These tools are helpful in debugging and optimizing your code. ■ The profiler lists the frequency of use and execution time for every method in your application. ■...
Page 52 - Call Graph
40 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 20 Turning on the profiler Now run your application by clicking on the Run button. Interact with your application as you normally would. When you’re finished, shut down the emulator.The profiler pops up with information about all the method...
Page 53 - The Call Graph; Wrap; Execution Time and Number of Calls; Cycles; %Cycles with Children
Chapter 5 Monitoring Applications 41 ■ The right side of the profiler shows the execution time and number of calls foreach method and its descendants. Note – The profiling values obtained from the emulator do not reflect actual values on a real device. 5.1.1 The Call Graph The call graph shows a hie...
Page 54 - Saving and Loading Profiler Information; Using the Memory Monitor
42 J2ME Wireless Toolkit User’s Guide • October 2004 5.1.3 Saving and Loading Profiler Information To save your profiler session, click on the Save button in the profiler window. Choose a file name. To load a profiler session, choose File > Utilities... from the KToolbar menu. Click on Open Sessi...
Page 56 - Using the Network Monitor
44 J2ME Wireless Toolkit User’s Guide • October 2004 ■ Name . The class name of the objects. ■ Live . The number of instances. Some of these might be eligible for garbage collection. ■ Total . The total number of objects that have been allocated since the application began. ■ Total Size . The total ...
Page 57 - Filtering Messages
Chapter 5 Monitoring Applications 45 FIGURE 24 The network monitor When your application makes any type of network connection, information aboutthe connection is captured and displayed. The figure shows two HTTP requestsand responses. The display on the left side shows a hierarchy of messages and me...
Page 58 - Sorting Messages
46 J2ME Wireless Toolkit User’s Guide • October 2004 Press the Filter Settings button to use the filter. Change the filter settings to suit your needs. When you are done entering filter settings, press OK to return to the network monitor. The Filter checkbox is checked, indicating that a filter is i...
Page 59 - Open Session; Clearing the Message Tree
Chapter 5 Monitoring Applications 47 To load a network monitor session, choose File > Utilities... from the KToolbar menu. Click on Open Session in the Network Monitor box. When you select a file, the network monitor window appears with all the session information. 5.3.4 Clearing the Message Tree...
Page 61 - Security and MIDlet Signing; Permissions
49 C H A P T E R 6 Security and MIDlet Signing MIDP 2.0 includes a comprehensive security model based on protection domains.MIDlet suites are installed into a protection domain which determines access toprotected functions. The MIDP 2.0 specification also includes a recommendedpractice for using pub...
Page 62 - Protection Domains
50 J2ME Wireless Toolkit User’s Guide • October 2004 In the J2ME Wireless Toolkit, you can add these permission attributes to a projectby clicking on the Settings... button in KToolbar. Select the Permissions tab. The MIDlet-Permissions box shows permissions which the MIDlet must possess, while the ...
Page 63 - Signing a MIDlet Suite
Chapter 6 Security and MIDlet Signing 51 ■ MIDlets in the minimum domain are denied all permissions. ■ The untrusted domain provides a high level of security for applications whose origins and authenticity cannot be determined. The user is prompted frequentlywhen the application attempts a sensitive...
Page 64 - Alias List; Managing Keys; Creating a New Key Pair
52 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 26 The MIDlet suite signing window Signing is very easy. Just select the key you want to use in the Alias List and click on the Sign MIDlet Suite... button. 6.4 Managing Keys The MIDlet signing window can also be used to manage keys. 6.4.1 ...
Page 65 - Create; Getting Real Keys
Chapter 6 Security and MIDlet Signing 53 FIGURE 27 Creating a new key pair After you click on Create , the toolkit prompts you to choose a protection domain. The connection between the key pair you just created and a protection domainmight seem oblique, but it makes perfect sense: ■ The toolkit crea...
Page 66 - Importing an Existing Key Pair; Action > Delete Selection; Managing Certificates
54 J2ME Wireless Toolkit User’s Guide • October 2004 The procedure for signing MIDlet suites with real keys works like this: 1. Generate a new key pair. In the J2ME Wireless Toolkit you can do this by pressing New Key Pair... in the MIDlet signing window, as described above. 2. Generate a Certificat...
Page 67 - Manage; Certificate List; Importing Certificates; Certificate
Chapter 6 Security and MIDlet Signing 55 Real devices have similar lists of root certificates, although they cannot usually bemodified by the user. When you want to deploy your application on a real device,you’ll have to use signing keys issued by a certificate authority whose rootcertificate is pre...
Page 68 - Removing Certificates; Delete Selection
56 J2ME Wireless Toolkit User’s Guide • October 2004 6.5.2 Removing Certificates To remove a certificate from the list, select the certificate and choose Action > Delete Selection .
Page 69 - Using the Wireless Messaging API; Setting Emulator Phone Numbers; WMA
57 C H A P T E R 7 Using the Wireless Messaging API The J2ME Wireless Toolkit supports the Wireless Messaging API (WMA) with asophisticated simulation environment. WMA 1.1 (JSR 120) enables MIDlets to sendand receive Short Message Service (SMS) or Cell Broadcast Service (CBS) messages.WMA 2.0 (JSR 2...
Page 70 - Simulating an Unreliable Network
58 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 29 Setting WMA preferences The Phone Number of Next Emulator field is just what it sounds like. If you fill in a number for this field, the next emulator instance will have that number. If the Phone Number of Next Emulator is already in use...
Page 71 - Open Console; Sending a Text SMS Message
Chapter 7 Using the Wireless Messaging API 59 7.3 Sending Messages With the WMAConsole The WMA console is a handy utility that allows you to send and receive messages.You can, for example, use the WMA console to send SMS messages to a MIDletrunning on the emulator. To launch the WMA console, choose ...
Page 72 - Send; Sending a Binary SMS Message; Binary SMS
60 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 31 Sending a text message The window automatically lists the phone numbers of all running emulatorinstances. Select a destination (Control-click to select multiple destinations) andenter a port number if you wish. Type your message and clic...
Page 73 - Sending Text or Binary CBS Messages
Chapter 7 Using the Wireless Messaging API 61 FIGURE 32 Sending a binary message Selecting recipients is the same as for sending text SMS messages. You can type inthe path of a file directly, or click on Browse... to open up a file chooser. 7.3.3 Sending Text or Binary CBS Messages Sending CBS messa...
Page 74 - Sending MMS Messages; To
62 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 33 Sending CBS messages 7.3.4 Sending MMS Messages MMS messages consist of one or more files, usually images or sounds. MMSmessage can be sent to multiple recipients. To send an MMS message from theWMA console, click on the Send MMS... butt...
Page 75 - Parts
Chapter 7 Using the Wireless Messaging API 63 FIGURE 34 Adding recipients for an MMS message To add media files to the message, click on the Parts tab. Click on Add to add a part to the message. To remove a part, select it and press Remove . FIGURE 35 Adding parts to an MMS message
Page 76 - Using the Network Monitor with WMA; MMS
64 J2ME Wireless Toolkit User’s Guide • October 2004 7.4 Receiving Messages in the WMAConsole The WMA console can also receive messages. If you look at the WMA consolewindow, you’ll see it has its own phone number in the title bar. You can sendmessages to the WMA console from your applications runni...
Page 77 - Using the Mobile Media API; Supported Formats and Protocols
65 C H A P T E R 8 Using the Mobile Media API The Mobile Media API (MMAPI) provides a standard API for rendering andcapturing time-based media, like audio or video. The API was designed to beflexible with respect to the media formats, protocols, and features supported byvarious devices. 8.1 Supporte...
Page 78 - Using MediaControlSkin
66 J2ME Wireless Toolkit User’s Guide • October 2004 8.2 Using MediaControlSkin The J2ME Wireless Toolkit comes with an emulator skin, MediaControlSkin , that is focused on multimedia playback and control. The skin includes buttons withsymbols representing play, stop, volume up and volume down, and ...
Page 79 - Working With Mobile 3D Graphics; Immediate Mode
67 C H A P T E R 9 Working With Mobile 3D Graphics This chapter provides a brief overview of working with 3D graphics content. 9.1 JSR 184 Overview JSR 184 is a specification that defines the Mobile 3D Graphics (M3G) API for J2ME.This API provides 3D functionality in a compact package that’s appropr...
Page 80 - Retained Mode; Trading Quality for Speed
68 J2ME Wireless Toolkit User’s Guide • October 2004 For an example of immediate mode, see the Life3D MIDlet in the Demo3D example application. 9.3 Retained Mode Most applications, particularly games, will use the retained mode or scene graphAPI. In this approach, a graphic designer or artist uses 3...
Page 81 - Creating Mobile 3D Graphics Content
Chapter 9 Working With Mobile 3D Graphics 69 9.5 Creating Mobile 3D Graphics Content Most mobile 3D applications will use scene graphs in resource files to describeobjects, scenes, and characters. Usually it is not programmers but graphic designersor artists who create the scene graphs, using standa...
Page 84 - MIDlet > External events; Unmount; The PIM API
72 J2ME Wireless Toolkit User’s Guide • October 2004 Each subdirectory of filesystem is called a root . The J2ME Wireless Toolkit provides a mechanism for managing roots. While the emualtor is running, choose MIDlet > External events from the emulator window’s menu. You’ll see a utility window fo...
Page 85 - Bluetooth Simulation Environment; OBEX Over Infrared
73 C H A P T E R 11 Using the Bluetooth and OBEXAPIs The J2ME Wireless Toolkit emulator supports JSR 82, the Java APIs for Bluetooth.JSR 82 includes two independent APIs: ■ The Bluetooth API provides an interface to Bluetooth wireless networking,including device discovery and data exchange. ■ The OB...
Page 86 - Setting OBEX and Bluetooth Preferences; OBEX Preferences; Discovery timeout
74 J2ME Wireless Toolkit User’s Guide • October 2004 11.3 Setting OBEX and Bluetooth Preferences The J2ME Wireless Toolkit allows you to configure the Bluetooth and OBEXsimulation environment. Choose Edit > Preferences... from the KToolbar menu to see the following window. FIGURE 38 Bluetooth and...
Page 87 - Bluetooth Discovery Timeout; Bluetooth; Bluetooth System Properties; System Properties; Bluetooth BCC Properties; BCC Properties
Chapter 11 Using the Bluetooth and OBEX APIs 75 11.3.2 Bluetooth Discovery Timeout In the Bluetooth section of the preferences window, the Device discovery timeout is the amount of time, in milliseconds, the emulator will wait while attempting tolocate other devices in the simulated Bluetooth enviro...
Page 89 - Using Web Services; Stub Generator; WSDL Filename or URL
77 C H A P T E R 12 Using Web Services The J2ME Wireless Toolkit emulator supports JSR 172, the J2ME Web ServicesSpecification. JSR 172 provides APIs for accessing web services from J2MEapplications. It also includes an API for parsing XML documents. The J2ME Wireless Toolkit provides a stub generat...
Page 91 - Application Demonstrations; Overview
79 A P P E N D I X A Application Demonstrations This appendix describes the application demonstrations that are bundled with theJ2ME Wireless Toolkit. A.1 Overview The J2ME Wireless Toolkit includes demonstration applications that highlight someof the technologies and APIs that are supported by the ...
Page 93 - General Instructions
Appendix A Application Demonstrations 81 A.2 General Instructions It's usually very simple to run one of the demonstration applications. This sectiondescribes the general procedure. More detailed instructions for specificdemonstrations are referenced in the table above. The first step is to run KToo...
Page 94 - BluetoothDemo
82 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 41 Opening a demonstration application project Select one and click on the Open Project button in the dialog. Once the application is opened, all you need to do is press the Run button. The device emulator will pop up running the example ap...
Page 95 - Client
Appendix A Application Demonstrations 83 FIGURE 42 Running the Bluetooth Demo server On the second emulator, choose Bluetooth Demo , then Client . The MIDlet tells you it’s ready to search for images. Choose Find . The MIDlet will find the other emulator and get a list of images from it. Select one ...
Page 99 - Network Preferences
Appendix A Application Demonstrations 87 FIGURE 46 A tireless skateboarder A.5 JSR172Demo JSR172Demo shows how to access a web service from a MIDlet. The web service is already running on an Internet server. You should be able to simply build and runthe example. If you are behind a firewall, you’ll ...
Page 100 - Simple Tones; Menu
88 J2ME Wireless Toolkit User’s Guide • October 2004 A.6.1 Simple Tones The Simple Tones example demonstrates how to use interactive synthetic tones.The first menu entries play tones with different pitch and duration using Manager.playTone() . Choosing the third menu item will play a chord on the in...
Page 102 - Quick Help; PausingAudioTest; Play; Video
90 J2ME Wireless Toolkit User’s Guide • October 2004 The commands may or may not be available depending on the media type thatSimple Player is playing. In addition, some commands can be invoked using thekeypad buttons. The following table describes the availability of commands, theirkeypad equivalen...
Page 103 - Snapshot; Attributes for mmademo; ObexDemo
Appendix A Application Demonstrations 91 Animated GIFs and video capture can be implemented using either a Form Item or a Canvas . The Video demonstration includes all the possibilities: ■ Animated GIF - Form [jar] shows an animated GIF as a Form Item . The form also includes some information about ...
Page 105 - Yes
Appendix A Application Demonstrations 93 FIGURE 48 Prompting to accept a connection Choose Yes . The image you selected is transferred over the simulated infrared link and displayed on the first emulator. FIGURE 49 A successfully transferred image
Page 106 - Browsing Files; Security
94 J2ME Wireless Toolkit User’s Guide • October 2004 A.8 PDAPDemo PDAPDemo shows how to use the PIM and FileConnection APIs that are part of the JSR 75 specification. A.8.1 Browsing Files To run the file browser, you’ll need to give the MIDlet appopriate securityauthorization. The easiest way to do ...
Page 107 - Properties; View
Appendix A Application Demonstrations 95 FIGURE 51 Contents of the root1 directory Using the commands in the demonstration, you can view the file or see itsproperties. Try selecting the file and choosing Properties or View from the menu. FIGURE 52 Viewing file properties and contents
Page 109 - New; Formatted Name; Commit
Appendix A Application Demonstrations 97 FIGURE 54 An empty contact list To add an item, choose New from the menu. The application prompts you for a Formatted Name for the item. You can add more data fields to this item using Add Field in the menu. You'll see a list of field names. Pick one, then en...
Page 110 - Back
98 J2ME Wireless Toolkit User’s Guide • October 2004 FIGURE 56 Saving an item You can return to the list by choosing the Back command. You'll see the item you just created in the list. The items that you create are stored in standard vCard or vCalendar format in the {toolkit} \appdb\ {skin} \pim dir...
Page 115 - Command Line Reference; Prerequisites; The Development Cycle
103 A P P E N D I X B Command Line Reference This appendix describes how to operate the J2ME Wireless Toolkit from thecommand line and details the steps required to build and run an application. It alsodescribes the J2ME Wireless Toolkit certificate manager utility, called MEKeyTool,and the MIDlet s...
Page 119 - Debugging
Appendix B Command Line Reference 107 remove=[< storage_name > | < storage_number > | all] Remove a previously installed application. The application is specified byits valid storage name or storage number. Specifying all , all previously installed applications are removed. transient=<...
Page 120 - Launching Toolkit GUI Components
108 J2ME Wireless Toolkit User’s Guide • October 2004 B.3 Launching Toolkit GUI Components The components of the J2ME Wireless Toolkit can all be launched from thecommand line. Each component is in the toolkit’s bin directory. B.4 Setting Emulator Preferences You can change the emulator preferences ...
Page 122 - Using Security Features
110 J2ME Wireless Toolkit User’s Guide • October 2004 B.5 Using Security Features The full spectrum of the J2ME Wireless Toolkit’s security features are also availablefrom the command line. You can adjust the emulator ’s default protection domain,sign MIDlet suites, and manage certificates. B.5.1 Ch...
Page 123 - Signing MIDlet Suites
Appendix B Command Line Reference 111 B.5.2 Signing MIDlet Suites JadTool is a command-line interface for signing MIDlet suites using public key cryptography according to the MIDP 2.0 specification. Signing a MIDlet suite is theprocess of adding the signer certificates and the digital signature of t...
Page 125 - Using the Stub Generator; Options
Appendix B Command Line Reference 113 B.6 Using the Stub Generator J2ME Clients can use the Stub Generator to access web services. The wscompiletool generates stubs, ties, serializers, and WSDL files used in JAX-RPC clients andservices. The tool reads a configuration file, which specifies either a W...
Page 126 - Example
114 J2ME Wireless Toolkit User’s Guide • October 2004 Note – Exactly one -gen option must be specified. The -f option requires a comma-separated list of features. TABLE 15 lists the features (delimited by commas) that can follow the -f option. The wscompile tool reads a WSDL file, compiled service e...
Page 127 - Internationalization; Locale Setting
115 A P P E N D I X C Internationalization This appendix describes setting the language displayed in the J2ME WirelessToolkit and the localization setting of the emulation environment. C.1 Locale Setting A locale is a geographic or political region or community that shares the samelanguage, customs,...
Page 128 - Emulated Locale; Character Encodings
116 J2ME Wireless Toolkit User’s Guide • October 2004 C.2 Emulated Locale The microedition.locale property is the MIDP system property that defines the current locale of the device, which is null by default. For the J2ME Wireless Toolkit emulator, this value is automatically set to the default local...
Page 129 - Java Compiler Encoding Setting
Appendix C Internationalization 117 Note – All the J2SE encoders are available in the emulated environment. See the J2ME Wireless Toolkit Basic Customization Guide for information on how to limit the list of available encoders for a specific device. C.3.1 Java Compiler Encoding Setting The javac.enc...