|
The JavaME Frequently Asked Questions list is a compilation of questions that are asked frequently by people using Java 2 Micro Edition . |
Table of ContentsTo quote Sun's website:
A highly optimized Java runtime environment, JavaME TM technology specifically addresses the vast consumer space, which covers the range of extremely tiny commodities such as smart cards or a pager all the way up to the set-top box, an appliance almost as powerful as a computer.Basically, JavaME is an umbrella term that refers to the collection of virtual machines, APIs and related elements that provide Java to handheld and embedded computing devices.
Table of ContentsA configuration defines a virtual machine and the minimum APIs that must be present. In defining the virtual machine, the configuration specifies the minimum amount of memory that must be present as well as the minimum processor type and speed.
Table of ContentsA profile refers to the APIs for a specific domain. For example, the MIDP (Mobile Information Device Profile, description below ) defines the APIs that are made available for pervasive computing devices such as mobile phones, wireless PDAs and similar devices.
Table of ContentsYes, provided that the virtual machine and device supports the functionality for the additonal profile. For example, OEMs can provide their own profiles in addition to the MIDP to allow MIDlets to access device-specific features of their device, such as the information contained in the SIM card on a phone. However, if such a profile were provide by an OEM such as Nokia, this profile wouldn't be portable to other devices, such as Motorola.
Another point to bring up is that, in order to use an optional API, it must already be present on the targeted device. For example, the MobileMedia API defines APIs for accessing such elements as the digital camera on a device. Developers can use these APIs to write camera-aware applications. However, merely writing an application against these APIs and loading the application on a device will not give you access to the camera. The APIs for the optional profile must be supported by the virtual machine itself as well. If support is not built into the virtual machine, then those optional features will not be available.
Table of ContentsA list of devices can be found here .
Table of ContentsPersonalJava was a previous implementation of Java for pervasive devices, based on Java 1.1. It is unrelated to JavaME. However, the Personal profile will fill the vacancy left by PersonalJava.
Table of ContentsNOTE: The FAQ maintainers are not lawyers and this answer should not be construed as legal advice. With this understood, you may read the following as our possibly incorrect interpretation of the licensee agreement.
When you downloaded the reference implementation, you agreed to the Sun Community Source License, which forbids you from distributing the source code for the reference implementation to anybody not also a licensee (section d, part i). You can only distribute binaries for evaluation purposes and cannot sell the ported VM (section d, part ii).
Table of ContentsThe manifest must contain at least the following fields:
- MIDlet-Name *
- MIDlet-Version *
- MIDlet-Vendor *
- MIDlet-# (where # is the MIDlet number, one for each MIDlet)
- MicroEdition-Profile
- MicroEdition-Configuration
* Value must exactly match those present in the JAD file.
Table of ContentsA Java Application Descriptor must contain, at the minimum, the following fields:
- MIDlet-Name *
- MIDlet-Version *
- MIDlet-Vendor *
- MIDlet-Jar-URL
- MIDlet-Jar-Size
* Value must exactly match those present in the manifest.
Table of ContentsAt JavaOne 2005, Sun announced a new naming convention for Java technologies . With this change, the micro-edition technologies were renamed to be Java ME, dropping the "2" in the name to avoid confusing customers or building an expectation for some future J3ME.
Table of ContentsThere are several, infact.
NAME URL comp.lang.java.programmer comp.lang.java.programmer CLDC-FEEDBACK http://archives.java.sun.com/cldc-feedback.html KVM-INTEREST http://archives.java.sun.com/kvm-interest.html J2ME-CDC-INTEREST http://archives.java.sun.com/j2me-cdc-interest.html Forum Nokia http://www.forum.nokia.com Howard Forums http://www.howardforums.com
Table of ContentsThe following is an incomplete list of archives where past messages are stored for some JavaME-related mailing lists:
Table of ContentsFor a device to support the CLDC, it must have at minimum:
- 16-/32-bit RISC/CISC processor
- 160k of memory (128k of which is for the VM and APIs)
- some form of network connectivity
Table of ContentsThe simple answer is: you can't . JNI is not available within the resource constrained KVM.
Some people will then bring up the KNI as an alternative/solution. This is, however, an incorrect answer and not a solution. The KNI is a Sun-specific porting layer, introduced into the reference implementation for the MIDP 2.0 and the CLDC 1.0.4. The purpose of this layer is to make porting these and future reference implementations to new platforms, and cannot be used as a means of linking native code at runtime.
Table of ContentsThe CLDC 1.0 specification does not support floating point math. However, support for floating point math was introduced with the CLDC 1.1 specification .
If you're working with a device that is built on the CLDC 1.0 specification and you need floating point math capabilities, you can download and use the MathFP library.
Table of ContentsThe MIDP defines a set of APIs for mobile devices, such as cell phones and low-end PDAs (higher-end PDAs will better benefit from more powerful profiles such as the Personal Profile ).
Table of ContentsThere are currently two versions of the MIDP specification: version 1.0 and version 2.0 (reference to as MIDP-NG or MIDP Next Generation). The 1.0 specification was the first profile released under the JavaME umbrella in 2000. The 2.0 specification was released in 2002 and addressed many of the shortcomings of the original specification. The 2.0 specification is also backwards compatible with 1.0.
Table of ContentsThere are several sources of conflicting information on this subject. This link claims that it stands for "Limited Connected Device UI", while this link claims that it stands for "Liquid Crystal Display UI", and JavaME Enterprise Development claims it stands for "Least Common Denominator UI".
So, I went to the source (or, more exactly, I asked a question in the KVM-INTEREST mailing list and received a response) and asked for the definition. What I was told was:
...I emailed Jim [Jim Van Peursem] (MIDP 2.0 lead). He looked through his notes. He says that in Mark V. [Mark VandenBrink] (MIDP 1.0 lead) and Roger R's [Roger Riggs] MIDP 1.0 book, Mark calls it "Limited Connected Device" UI.I trust this as the ultimate source for the information.
Table of ContentsIn June, 2003, Palm announced an alliance with IBM to release IBM's WebSphere Micro Environment on their Tungsten line of handheld devices.
You can also download MIDP4Palm , which was the first MIDP platform released for the PalmOS.
Read this for a note on the previously announced PDA Profile .
Table of ContentsThere are several macros used by the makefile to determine where elements exist on the system. One,
ALT_BOOTDIR, tells the makefile where Java is installed. By redefining this macro in the commandline to point to where Java's installed on your system, the build should complete (barring any other differences between your system and the expections of the makefile).Assuming your JDK is installed in /usr/lib/j2se/1.3 (the default for Debian with JDK 1.3 installed), you would use the following commandline:
make ALT_BOOTDIR=/usr/lib/j2se/1.3
Table of ContentsNot with MIDP. However, there are APIs available in the PDA Optional Packages for the JavaME Platform that will give you access to this information.
Table of ContentsSince the MIDP is build on top of the CLDC , this question is more appropriately answered in the CLDC section here .
Table of ContentsThe PDA Profile is now called the PDA Optional Packages for the JavaME Platform and consists of two separate, optional packages:
- Personal Information Manager APIs - Enables the developer to access the native personal information management data that resides on the device, including the address book, calendar, and to-do lists.
- FileConnection APIs - Gives the developer access to file systems on the device, such as external memory cards.
These APIs will be implemented by the VM vendor on other JavaME profiles, such as the MIDP and Personal (and Personal Basis) Profile , and will enhance the CLDC .
Table of ContentsFor a device to support the CDC, it must have at minimum:
- 32-bit RISC/CISC processor
- 2M RAM
- some form of network connectivity
Table of ContentsThe Foundation profile, when used by itself, is intended for embedded and headless devices; i.e., devices that have no user interface, such as routers and gateway devices.
There are other profiles, such as the Personal Profile , that are intended to run on top of the Foundation profile.
Table of ContentsThe Personal Profile is the JavaME replacement for PersonalJava .
Table of ContentsThe Personal Basis Profile ( JSR-129 )defines a minimal set of user interface APIs. The Personal Profile ( JSR-62 ) builds on the APIs from the Personal Basis Profile.
The Personal Profile is intended to be the next step in the migration path from PersonalJava and, as such, needs to support the full feature set of PersonalJava. The Personal Basis Profile is intended to address devices less capable than those targeted by the Personal Profile, providing a scaled down API set.
Table of ContentsThe build environment requires a few macros be defined at the commandline to tell it the locations for your JDK, the shell to use and the location for specific GNU tools. The following table lists the macros and the values necessary to perform the build on a Debian Linux system:
MACRO NAME DESCRIPTION VALUE ON DEBIAN JDK_HOME The root of your JDK installation. /usr/lib/j2se/1.3 SHELL The path to the shell used for executing commands. /bin/bash CVM_GNU_TOOLS_PATH The location for the standard GNU toolset. /usr/bin
Table of ContentsThe Generic Connection Framework is the paradigm used for creating
javax.microedition.io.Connectionobjects that support different protocols. A URI defining the protocol and remote end-point for the network connection is passed to thejavax.microedition.io.Connectorclass via one of theopen()methods and ajavax.microedition.io.Connection-type object is returned, ready to connect to the end-point.
Table of ContentsYes, if the device supports such a connection. The only required protocol is HTTP, but the OEM can provide other protocols as well.
Table of ContentsYou don't. With the the GCF , there is no support for server sockets. However, you can instead create a
javax.microedition.io.StreamConnectionNotifierinstance and invoke itsacceptAndOpen()API. The following snippet demonstrates how to do this:public void waitForConnection() { // change the port number to be whatever is appropriate for your application StreamConnectionNotifier server = (StreamConnectionNotifier )Connector.open("serversocket://:10000"); StreamConnection conn = server.acceptAndOpen(); // do something useful with the new connection }
Table of ContentsThe MIDP 1.0 specification does not provide an API for doing this. The OEM, though, is free to add any additional profiles they wish to the mix.
The MIDP 2.0 specification includes
platformRequest(String)method in thejavax.microedition.midlet.MIDletclass. The telephone number can be passed in the formtel:<number>as defined in RFC 2806 .
Table of ContentsThe MIDP 1.0 specification does not include APIs for accessing the phone number or SIM information for the device on which it's running. OEM's are free to add additional APIs for accessing this information, though.
The MIDP 2.0 specification includes
platformRequest(String)which OEMs can use to provide this information if they so choose.
Table of ContentsThe answer involves the
java.io.InputStreamandjava.io.OutputStreamobjects related to thejavax.microedition.io.HttpConnectionobject in use. If you're using either input or output streams, it is necessary to close them after you've finished with the connection. Otherwise, the underlying implementation is most likely keeping thejavax.microedition.io.Connectionobject open. Simply callclose()on all related streams and it should solve the problem.Also, be sure you're not using persistent connections if you're going to multiple servers during an application's sessions.
Table of ContentsNo. Not all MIDP devices use IP-based networking, and the MIDP expert group didn't include an API for determining the address for those devices that do.
Table of ContentsIn HTTP 1.1, persistent connections are the default behavior required by the specification. So, no special coding is required to suggest to the device that the underlying connection should be maintained between HTTP requests.
See the next question for information on how to turn off persistent connections.
Table of ContentsWhen setting up the connection object, set the "Connection" property to "close". This will tell the server to tear down the connection after the response has been set.
HttpConnection conn = (HttpConnection )connector.open("http://foo.com/index.jsp"); // set the Connection property if(!persistent) conn.setRequestProperty("Connection","close");
Table of ContentsNo, you cannot use the same object more than once. The
HttpConnectionobject represents exactly ONE round-trip connection with the server and, as such, cannot be used for transmitting data more than one.The connection object can exist in one of three states: 1) Setup , 2) Connected and 3) Closed and, when it moves to a new state, it can not return to a previous state. So, when data is sent to the server, the connection has moved from the setup state into the connected state. In the connected state, the connection can only receive data from the server and cannot send any more data to the server. When the incoming data has been received and the
InputStreamobjects closed (or the connection itself is closed, but I'm assuming you were diligent and closed your input and output streams first <g>), the connection moves into the closed state and no further data can be read from the connection. Any attempt to use methods from a previous state on a connection object will result in anIOExceptionbeing thrown.If what you're trying to accomplish is persistent connections, please see this frequently asked question .
Table of ContentsYou can send SMS messages, provided the device hosting your MIDlet supports JSR-120 , the Wireless Messaging API 1.0. If your device supports version 2.0 of this specification, then you will be able to send MMS messages as well.
Table of ContentsNot with MIDP 1.0. According to the specification,
javax.microedition.lcdui.Formonly has APIs for appending elements using an instance ofjava.lang.String(which is a shortcut to creating an instance ofjavax.microedition.lcdui.StringItem,javax.microedition.lcdui.Image(which is a shortcut to creating an instance ofjavax.microedition.lcdui.ImageItemorjavax.microedition.lcdui.Item. There's no way to create a new subclass ofjavax.microedition.lcdui.Itemsince the single abstract method,paint(), has package (default) protection. It is also against the licensing agreement (per section e, subsection iv) to create a new subclass in thejavax.*package hierarchy. Finally, even if the licensing agreement were ignored, most VMs will ignore any class in the java[x].* hierarchy.In MIDP 2.0, the class
javax.microedition.lcdui.CustomItemwas introduced. Subclassing this class will allow you to create new elements that can be added to forms.
Table of ContentsUnfortunately, no. There's no API available for extracting anything more than the image's width, height, an instance of
javax.microedition.lcdui.Graphicsand mutability.With the MIDP 2.0 you can get the raw bytes from an instance of
javax.microedition.lcdui.Imagethrough thegetRGB()API.
Table of ContentsThe high level user interface APIs in
javax.microedition.lcduido not give you access to the low level key events. These events are only available to classes which extendjavax.microedition.lcdui.Canvas.There is an alternative, though it may not meet the requirements above. The
javax.microedition.lcdui.ItemStateListenerinterface defines a contract for objects that will be notified of state changes within ajavax.microedition.lcdui.Formobject. However, there is no specific set of conditions under which these notifications are sent; i.e., it is up to the device/VM vendor to decide when and if notifications will be sent. So, notifications will vary greatly between different devices and VM implementations.
Table of ContentsNo. There is no way to mark up the text being displayed by these components.
Table of ContentsNo, you can't.
When you create an instance of
Commandyou can only specify a label, a command type and a priority. The MIDP implementation uses the type and priority of the commands to be displayed to determine how the commands will be presented to the user. It will also make a best effort to map keys to the appropriate button for that device; i.e., if the device normally displays OK buttons on the right side, then it will attempt to present your command of typeCommand.OKon the right side.Also, not all MIDs have softkeys. For example, the RIM Blackberry displays the
Commands as menu items. On such a device, there's no concept of a softkey. Instead, on such devices, the implementation will use the priority of theCommands as well as their type in order to group and sort them prior to displaying them to the user. So, be sure that each command within each group has a unique priority.
Table of ContentsVerify that your image file is present in your MIDlet suite's JAR file and that it's JAR entry is the same as your code expects; i.e., if you're using
Image.createImage("/foo.png"), then there must be a JAR entry named/foo.pngor else the MIDP implementation will throw anIOException. Remember, also, that filenames are case sensitive and that you have to use the full entry name for the image.
Table of ContentsNo. The MIDlet is limited to only loading classes from within it's suite. This prevents hackers from loading dangerous classes. It also prevents a device from using precious bandwidth for loading classes over the air or via low-bandwidth network connections.
Table of ContentsTo read a file from your MIDlet suite's JAR file, use the
java.lang.class.getResourceAsStream()API.
Table of ContentsWith MIDP 1.0, there's no way to automatically launch a MIDlet either at device startup or upon reception of some data.
With MIDP 2.0, there's the concept of the push registry , which allows a MIDlet to register itself for network and timer initiated MIDlet activation. Take a look at the
javax.microedition.io.PushRegistryclass Javadocs for more details on using the push registry.
Table of ContentsOn most devices, the only thread that is suspended is the main application thread for the MIDlet. Any other thread that was started by the MIDlet will most likely (but not always) continue running.
Table of ContentsThe following system properties are available, as of MIDP 2.0, to help determine the type of device on which the MIDlet suite is running:
microedition.platform Identifies the device type or host platform, or returns nullif the value is undefinedmicroedition.encoding The default character encoding. microedition.configuration The configuration this device has implemented. microedition.profiles The profiles this device has implemented. microedition.locale The current locale for the device. This value may be null.A list of properties is also defined here .
Table of ContentsTo get the handset's location, you would have to have a handset that supports the Location API for JavaME . With this API you can get the location for the handset at runtime. Unless the OEM has implemented this API on the handset, you will not be able to determine the physical location of the device.
Table of ContentsMinimally, you will need:
- JDK version 1.3 or higher
- the reference implementation for the targeted profile
- the reference implementation for the targeted configuration
- the ANT build utility (click here for an example build.xml file)
The reference implementations provide the APIs for compiling the application. They also provide the preverifier, which performs the initial verification of the created byte code. This saves the device from having to perform initial verification, which can be resource expensive. It also inserts extra information into the byte code which is needed by the VM, but which is ignored by the J2SE VM, so compiled classes can be shared between JavaME and J2SE.
This all said, I would now recommend instead that you download Sun's Wireless Toolkit 2.x or later , Eclipse 3.x or later and EclipseME . This gives the most complete environment for JavaME development for the price.
Table of ContentsI've removed the ANT example from the FAQ. It is recommended that, rather than using this example for most tasks, you use the Antenna suite of ANT tasks. With Antenna, all of the more awkward tasks, such as preverification, obfuscation and the launching of emulators, have already been taken care of for you and are far easier to integrate into your build environment.
Table of Contents
- Download the CLDC reference implementations here .
- Download the MIDP reference implementations here .
- Download the CDC reference implementations here .
- Download the Foundation Profile reference implementations here .
- Download the Personal Basis Profile reference implementations here .
- Download the Personal Profile reference implementations here .
- Download the RMI Optional Packages reference implentations here .
Table of ContentsThis answer assumes you're running in a Unix/Linux environment, and installed using the root account.
When the toolkit was installed, it created the directory structure with root as owner (assuming you didn't install the product as yourself in your home directory, or one to which you have write access). The file access permissions for the tree are root.[ staff on my system]
rwxr-sr-x. As you can tell from this, only members of the owning group can read the directories where the toolkit was installed. In addition, only root can write to the directory tree. So, unless you are running the toolkit as root (not a very good practice at all) you will not be able to run any of the samples for the toolkit until you make some changes to the directory structure.The best thing to do is to go into the
JavaMEwtk/appsdirectory and change the permissions to allow the owning group to write to the directories as well. From the installation directory, execute the command:find apps -type d -exec chmod 775 {} \;This will descend into each directory and change the permissions to allow members of the owning group to write to the directories, but will not allow anybody to change the files in the directories. This way, the source code will still be read-only, but users will be able to compile and execute them.
import javax.microedition.lcdui.Command; import
javax.microedition.lcdui.CommandListener; import
javax.microedition.lcdui.Display; import
javax.microedition.lcdui.Displayable; import
javax.microedition.lcdui.Form; import
javax.microedition.midlet.MIDlet; public class HelloWorld
extends MIDlet implements CommandListener { public HelloWorld() { }
public void startApp() { Form form = new Form("Hello world!");
form.addCommand(new Command("Exit",Command.EXIT,1));
form.setCommandListener(this);
Display.getDisplay(this).setCurrent(form); } public void
pauseApp() { } public void destroyApp(boolean unconditional) { }
public void commandAction(Command c,Displayable d) {
if(c.getCommandType() == Command.EXIT) { notifyDestroyed(); } } }
Table of Contents
Table of ContentsIt is a problem with the way obfuscation works in Java. Most obfuscators will begin altering the bytecode by traversing the methods and classes used by your MIDlet, and then examines the methods and classes used by those methods, to obfuscate the code. When RetroGuard hits a native method (for example, one within the MIDP API that's implemented in the KVM rather than in Java code), it cannot handle the situation and returns an error.
If you're using an archive or subdirectory in your classpath for RetroGuard that contains a working version of the MIDP API, RetroGuard is hitting one or more of the above-mentioned native code references. It is this that is causing the failure during obfuscation.
The solution is to use the file
emptyapi.zip, which comes with the Wireless Toolkit. This archive provides all of the public interfaces used by the MID Profile without any of the underlying implementation code or references to any native methods.
Table of ContentsMy guess is that you're using JDK version 1.4 or higher. The problem is that the byte code format generated by the 1.4 and later compiler is incompatible with earlier versions of the
preverifyexecutable that you're using.To fix the problem, upgrade your toolkit to the latest version and see if that fixes the problem. If you're using the latest tool, or if your tool vendor hasn't upgraded their tools, then you can use the following commandline:
javac {whatever arguments you normally use} -target 1.1 {your more arguments}This will cause the compiler to produce pre-1.4 byte code.
If you're using J2SDK 5, then you'll want to add the following commandline argument instead:
javac {whatever arguments you normally use} -source 1.2 -target 1.2
Table of ContentsTo access the emulator using sockets, start the emulator and include the following command line argument:
-Xrunjdwp:transport=dt_socket,address=[the local port],server=y,suspend=yreplacing
[the local port]with an available port number. Then, give the same port number to your debugger in order to connect to the emulator.To access the emulator using shared memory, start the emulator and, instead of specifying a port, specify the name of the shared memory page using the following command line argument:
-Xrunjdwp:transport=dt_shmem,address=[the shared memory page],server=y,suspend=yreplacing
[the shared memory page]with a unique memory pagename. Then give the same name to your debugger in order to access the shared memory.
Table of ContentsYou need to connect your iDEN phone to a serial port on your computer using a data cable. Then, from a terminal application (set to 19200bps , issue the following command:
AT+WS46=252;+WS45=0;+IAPPL=2;DThis will cause all output sent to
System.outandSystem.errto be sent to the serial port and, finally, to your terminal application.
Table of ContentsYou copy these and any other files into the
res(short for resources) directory beneath your application's directory. Within your code you would refer to them using "/res/[filename]".
Table of ContentsYes, there are a few.
For Windows, there is Tile Studio , World Creator and Mappy .
Table of ContentsThis depends on the device in question. There are two ways to put a MIDlet suite onto a device:
- Over-the-air (OTA) provisioning
- Provisioning via data cable
Over-the-air provisioning is when the application is downloaded from a web or portal site and installed onto the device. An overview of OTA provisioning can be found here . The basic flow is that the device retrieves the JAD file from a web or portal site and determines whether the MIDlet suite can install onto the device. If the suite is acceptable (i.e., it's new to the device, or it's the same or more recent version of an installed suite, and it's not too big [if there's a size restriction imposed by the carrier]) then the user is prompted if they want continue with the installation. If the user accepts, then the MIDlet suite is downloaded over the air and installed onto the device.
Provisioning via a data cable is more direct in its approach. Software is provided by the OEM and is used to connect to the device normally via a serial or USB cable connected to the device, such as the cradle for a Palm or RIM, or the data cable for the Motorola phones. Using this software, the developer browses the local file system and selects the JAR and JAD files to install onto the device. The software then negotiates a connection with the device and uploads the MIDlet suite.
Table of ContentsIn order for a web server to host a MIDlet suite, it has to be configured to send the property content types when sending a JAR and JAD file. To do so, the following MIME types must be configured for the server:
FILE TYPE EXTENSION MIME TYPE JAR .jar application/java-archive JAD .jad text/vnd.sun.j2me.app-descriptor To set these values in Apache2, add the following lines to your /etc/apache2/apache2.conf file:
AddEncoding application/java-archive jar
AddEncoding text/vnd.sun.j2me.app-descriptor jad
Table of ContentsWell, the first answer is to use the emulators that ship with Sun's Wireless Toolkit , being sure to grab the appropriate version for the MIDP version you're targeting.
Additionally, nearly every device manufacturer has their own emulators available for their devices. Motorola, Nokia and RIM even ship either complete IDEs (such as Metrowerks Code Warrior and Nokia's Developer Suite for J2ME .
For those looking for a Java-based solution, there is an (incomplete at this time) emulator written in Java called ME4SE that is an emulator built of Java 2 Standard Edition. It includes the ability to run the MIDlet within an applet in a user's web browser. There is also the MicroEmulator project which has built a MIDP emulator using the JDK 1.1. This would allow MIDlets to be demonstrated from within older browsers.
Another tool that provides a pure Java environment for emulator a MID is the MPowerplayer SDK . To quote their website:
The mpowerplayer software developer kit includes the mpowerplayer as a standalone application. It's a pure Java emulator implementing MIDP 2.0 and MMAPI, suitable for integration with your favorite environment and IDE.
Table of ContentsThere are several potential reasons for this problem showing up:
- You have missing or incorrectly formatted mandatory attributes in your JAD file. For Motorola phones, the limitations of the Mandatory attributes are:
- MIDlet-Name (max 32 character)
- MIDlet-Version MIDlet-Vendor (max 32 characters)
- MIDlet-JAR-URL (up to 256 characters)
- MIDlet-JAR-Size (must match JAR file size in bytes)
- The version of the MIDP and/or CLDC specified is not supported by the handset itself
- The attributes that are in both the JAD file and the MIDlet suite's manifest do not match. Be sure to check the files with a hex editor to ensure that one or the other does not have a special character in it
- One or more classes in the MIDlet suite refer to classes not found on the handset; for example, your MIDlet suite uses the Wireless Messaging APIs but those APIs aren't present on the handset.
- The value for the MIDlet-Data-Size (if used) exceeds maximum value for the handset (for Motorola V300,V400, V525, V500 and V600 this size is 512k, or 524,288 bytes).
Table of ContentsWith your handset, press the following button sequence:
# * [menu] [right navigation button]
Table of ContentsOn my V400 (and my V300 at work) I press the following sequence:
* # 9 9 9 9 #Although this same information is also available if you go to
MENU -> Settings -> Phone Status -> Other Information, where each field is selectable individually.
Table of ContentsOn the i730 it's:
Settings -> Phone Calls -> Java App Control -> [your MIDlet]
Table of Contents( NOTE: this is unverified by the FAQ maintainers)
Enter the sequence "#*#159#*#" while in the Java menu on the phone. Then choose to mark the app as a "Permanent App". It will then not be uninstallable unless the user re-enters the key sequence and marks the app as uninstallable. Permissions for the app can also be set here as well.
Table of ContentsThere are serveral possibilities:
- Missing or incorrectly formatted mandatory JAD Attributes. The limitations of the Mandatory attributes are: MIDlet-Name (max 32 character), MIDlet-Version MIDlet-Vendor (max 32 characters), MIDlet-JAR-URL (up to 256 characters), MIDlet-JAR-Size (must match JAR file size in bytes)
- MIDP or CLDC compile version of MIDlet is not supported by the handset.
- JAD attributes do not match the Manifest in the JAR - check these files using a Hex Editior in case there are some "special" characters inserted in either file which do not appear in your text editor.
- Class usage compiled into the MIDlet which does not exist in the handset.
- MIDlet-Data-Size (if used) exceeds maximum value (v300,v400, v525, v500, v600) = 512k (524288 bytes).
Table of ContentsAs your device connects to the network, you'll notice in the upper-right corner of the display the letters "NXTL". These letters will individually cycle through upper- and lower-case states before finally (hopefully) becoming all upper-case, which signals a good connection to the network.
But, why does it do this? What do these characters mean? I have the answer. After having spent some time on the phone with Nextel's technical support I was given this explanation for what each character stands for:
N Cellular network connectivity X Walky-talky feature connectivity T Packet data network connectivity L Network registration
Table of ContentsThere are multiple ways to install sofware onto your Nokia handset:
- Over-the-air provisioning
- Via infrared connection or data cable
- Via Bluetooth
To install over-the-air, you need to have a data plan with your wireless carrier. For Series 40 and 60 phones, go to the Services screen and select Bookmarks Setup a link to your JAD file (or to the page hosting the JAD file) by selection Options and then New bookmark . Once it's setup, go back to the Bookmarks screen and click the call button (or click Options and then Go to ) to open the link. Then follow the prompts to download and install the MIDlet suite.
To install via irDA, you need to have installed the appropriate PC Suite software from Nokia's website. Once installed, you can connect the handset to your PC and use the Application Installer too to deploy your application onto your handset.
For Bluetooth installation, you need to first connect to your handset via Bluetooth. Then, simply push the JAR and JAD files onto the handset. You should receive a message stating that new files were received and you need only follow the prompts to complete the installation process.
Table of ContentsWith your handset, press the following key sequence:
# * 0 0 0 0 *
Table of ContentsThe unverified answer (I've never talked with someone from Samsung) seems to be that, when the END key is pressed, the A600 does not notify the MIDlet but instead stops the VM itself from executing. So, rather than receiving a callback (either
MIDlet.pauseApp()orCanvas.hideNotify()) notification, your application will just stop .If you're writing a time-sensitive application, then you should probably put some sort of time checking into your code and attempt to detect such situations. In my case, I wrote a game that had the side-effect of the player losing on time when the END key was pressed. To solve the problem, I had my core loop grab the time when it started and the time when it was finished a single iteration. If that time value was greater than a normal update event, then it assumed the END key had been pressed and modified the game time accordingly.
Table of ContentsIf you're working in full-screen mode, what's happening is that the "Allow network access" prompt is being displayed but isn't visible since the app's controlling the entire screen. The workaround for this is to switch to non-full screen mode prior to making the first network access attempt, then switch back to full screen mode afterward.
Table of ContentsThe reason is going to be either of both of the following elements missing from your JAD file: either there's no
MIDlet-Data-Sizeentry (which is necessary) or yourMIDlet-Jar-URLdoes not have the full URL for the JAR file; i.e., it hasfilename.jarinstead ofhttp://yourwebsite/filename.jar. SprintPCS phones require the full URL for your MIDlet suite in order to download and install it to your handset.
Table of ContentsThis is related to Sprint's WAP gateway. It caches entries for increased performance, but at the expense of getting to updated material. Unfortunately, unless you have administrative rights to your webserver and can configure it to give content a short TTL, the only way you can get around this problem is to use a different name for the JAR and JAD everytime you upload a version to test.
My (Darryl's) personal strategy when testing on sprint phones is to just use a rolling series of filenames; i.e., the first set I put on my server is
a1.jaranda1.jad. After I've downloaded this, I delete the files and test. When I have to fix something and redeploy, I then deploy filesa2.jaranda2.jad.When I've finally gotten the point where I'm satisfied with the code and ready to hand it over to QA and my product manager, then I finally deploy the files with the proper name.
Table of ContentsTo play sounds on a Sprint device, you need to first create an instance of the
com.sprintpcs.media.Clipclass, providing it with either the full path to the sound file in your JAR, or an array of bytes that comprise the sound file.Once you have a
Clip, you then pass it to one of thecom.sprintpcs.media.Playerclass's static methods:
play(Clip clip,int repeat), which plays the clip for the specified number of repetitions, but will end the clip should another one be playedplayBackground(Clip clip,int repeat), which plays the clip for the specified number of repetitions. The sound will be paused when another sound is played, and will continue until that sound is completed.
Table of ContentsThis answer assumes two things:
- You're in an area where there is no T-Mobile coverage, and
- You're in an area where Cingular and at least one other carrier is present (such as North Carolina)
If these assumptions are correct, then you need to manually select your network and choose Cingular . At least here in North Carolina, T-Mobile has no network coverage and so has a sharing agreement with Cingular. When I use a T-Mobile device, it sometimes selects AT&T rather than Cingular and will have no Internet connectivity. Simply switching it back to Cingular solves the problem, for me anyway.
Table of ContentsThis indicates whether the MIDlet will remain active in memory (resident) in the background and able to process events.