Frequently Asked Questions
J2ME Wireless Toolkit
|
What's the fastest way to get started?
To get started using KToolbar, try opening some of the demonstration projects and running them. You can also examine and modify the source code for the demonstrations. More information is here.
Why does the emulator ask me if I can connect to the network?
Depending on the protection domain in which your application runs, the emulator may ask permission for certain operations including network access. For an overview of permissions and protection domains in MIDP 2.0, see Understanding MIDP 2.0's Security Architecture.
How can I test the push registry?
To observe MIDlets being launched in response to incoming network connections, you will need to run your application using the Run via OTA feature. Run via OTA simulates the process of installing an application on a device and will correctly respond to incoming network connections based on entries in the push registry. See the User's Guide for more information.
Can I use an obfuscator?
Yes. The toolkit supports ProGuard and includes an architecture for supporting any obfuscator. See the User's Guide for more information.
Can I use a debugger?
Yes. Most likely you will use the J2ME Wireless Toolkit in conjunction with the debugger in an IDE. The User's Guide has more information on using a debugger.
I created a new project. Now what do I do?
The next step is to edit source code for the project. The messages in the KToolbar console tell you where to put the source code, resource files, and library files. If you're still not sure what to do, Chapter 2 of the User's Guide contains a simple example.
Where are my project's JAD and JAR files?
First you need to package the project by choosing Project > Package > Create Package from the KToolbar menu. The MIDlet suite descriptor and JAR will be placed in the bin directory of your project.
My MIDlet won't talk to my server. What's wrong?
Make sure your server is speaking the right version of HTTP. You can adjust the version used by the emulator in the KToolbar preferences. A good way to debug network problems is to use the network monitor. See the User's Guide for details.
How do I learn about MIDP?
A great place to start is Learning Path: Getting Started with MIDP 2.0.
Why won't my device recognize my signed MIDlet suite?
Real devices on real networks may have root certificates that are specific to the manufacturer or wireless carrier. Check with your device manufacturer or wireless carrier for details on signed MIDlets.
Can I build applications for MIDP 1.0 devices?
Yes, you can build applications for a wide variety of software stacks. Click on the Settings... button to edit project settings, then choose the configuration, profile, and optional packages you would like on the API Selection tab.
When running my MIDlet, a security alert is displayed and cannot be dismissed.
You are probably trying to access a protected API (for example, opening a connection) from your
commandAction()
method, which is locking the UI thread. Access to protected APIs should be done from a separate thread. Refer to the NetworkDemo for an example on how this can be done.
How can I make sure that my application only uses specific APIs, for example only MIDP 2.0 APIs?
Select the "API Selection" tab in the Settings dialog box and select the Target Platform and APIs that you want to use.
I can still use an API in the emualtor even though it's not selected in the API selection project settings. What's going on?
The API selection project settings applies to building only. The emulator always supports all available APIs.
Where can I find out more about MIDP, CLDC, MMAPI, and WMA?
See http://java.sun.com/products/midp, http://java.sun.com/products/cldc, http://java.sun.com/products/mmapi, and http://java.sun.com/products/wma.
I want to use an external library, but when I try to build a
MIDlet suite that uses it, I get Error preverifying
class...
messages.
If you get this error, you are probably using a class library that was written for Java 2 Platform, Standard Edition. This toolkit supports the development of MIDP applications, which have limited capabilities compared to their J2SE counterparts.
I get Error loading class...
messages when running the
preverifier.
First, check that your Java sources and libraries can be used with CLDC and MIDP APIs.
Then, ensure that you installed the J2ME Wireless Toolkit in a directory whose path does not contain any spaces. For example, the toolkit will not work with the path
C:\Program Files\WTK22
.If you installed the toolkit in a directory whose path contains spaces, you must uninstall the toolkit and reinstall it in a directory whose pathname does not contain any spaces.
Can I use network protocols other than HTTP and HTTPS in J2ME applications?
Yes. The MIDP 2.0 specification introduces optional support for socket, server socket, datagram, SSL, and serial (COMM) communication. The WMA specification provides support for SMS, CBS, and MMS messaging. The toolkit's support for JSR 75 and JSR 82 adds file, Bluetooth, and OBEX connections as well.
The Emulator incorrectly displays text in languages other than English. How can I change the fonts?
To display text in languages other than English, you should do one of the following actions:
- Set the default locale of the desktop to the language you are trying to display.
- Update the font configuration of the emulated device. See the Basic Customization Guide for details.
The device image displayed by the emulator is too small. How can I
enlarge it?
How can I enable touch screen events in the emulator?
How can I change the set of character encoding converters available for
a device?
See the Basic Customization Guide for information on modifying the default emulator.
How can I transfer a MIDlet Suite to a real device?
It depends entirely on the device. Each device manufacturer that supports MIDP must provide a mechanism for transferring MIDlets onto its devices.
How can I access a Comm port when running on Linux?
You must set the following permission at the command line (note that you must have root privileges):
chmod a+w /dev/ttyS[01]
I have another question, and I can't find the answer here.
Send your questions to
.
Copyright © 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to the license terms.