Sun Microsystems J2ME manual Using a Debugger, Deploying Applications on a Web Server

Models: J2ME

1 134
Download 134 pages 62.02 Kb
Page 29
Image 29

2.5Using a Debugger

A variation on running your application is running it with a debugger. A debugger allows you to monitor the running application more closely, set breakpoints, and examine variables.

You will need to supply your own debugger. You can use the jdb debugger from J2SE™ or another debugger of your choice.

Begin by choosing Project > Debug from the KToolbar menu. Enter the TCP/IP port number that the debugger will use to connect to the emulator. Click on Debug. The emulator begins running and waits for a connection from a debugger.

Start up your debugger and attach it to the port you specified. Make sure to set the remote debugger to run in remote mode and to use TCP/IP. For more information, consult the debugger’s documentation.

Information about using jdb with the J2ME Wireless Toolkit is here:

Debugging MIDlets

http://developers.sun.com/techtopics/mobility/midp/questions/

jdb/

2.6Deploying Applications on a Web Server

The MIDP 2.0 specification includes the Over The Air User Initiated Provisioning Specification, which describes how MIDlet suites can be transferred over-the-air (OTA) to a device. You can test this type of scenario using the J2ME Wireless Toolkit emulator.

To deploy a packaged MIDP application remotely on a Web server:

1.Change the JAD file’s MIDlet-Jar-URL property to the URL of the JAR file. The URL should be an absolute path. For example:

MIDlet-Jar-URL: http://your.server.com/midlets/example.jar

2.Ensure that the Web server uses the correct MIME types for JAD and JAR files:

a.For MIDlet suite descriptors, map the .jad extension to the text/ vnd.sun.j2me.app-descriptorMIME type.

b.For MIDlet suite JARs, map the .jar extension to the application/java- archive MIME type.

Chapter 2 Developing MIDlet Suites 17

Page 29
Image 29
Sun Microsystems J2ME manual Using a Debugger, Deploying Applications on a Web Server