- in the meantime, thanks to XDA-Devs user defcomg, a new, third-party, free Bluetooth (JSR-82) library, BlueCove has been found, which supports IBM J9.
- In the second part of this article, I elaborate on how you can ďhackĒ some Nokia classes into MIDlets so that they have a chance to run. I also explain how you can force the installation of MIDlets that, otherwise, are refused to be deployed because of missing library (for example, Bluetooth under Jbed) support.
Letís start with the compatibility issues.
1.1 Real-world (!) compatibility
First, itís only IBM J9-compliant (NO TAO, NO Jbed, NO Jblend). Even under J9, unfortunately, itís (as of this writing) pretty much far away from REALLY working. While it correctly implements Bluetooth discovery, in general, it doesnít go further and just crashes at actually connecting (not only discovering). Iíve tested this with both the Microsoft and the Widcomm Bluetooth stack, using version 6.1.1 (that is, the latest one) of IBM J9.
My compliance test results are as follows:
Super Bluetooth Hack 1.07
(note that the two (2nd/3rd) versions are exactly the same): doesnít even start (IncompatibleClassChangeError
discovering works; the actual connection doesnít (IncompatibleClassChangeError with javax.microedition.io.Connection).
3D Constructo Combat
: The same: it is able to discover other devices:
but, upon actually connecting to them (or, when you start it in server mode), it immediately crashes and exits.
1.2 Downloading, installing
If you still want to give it a try (again, itís pretty much useless as of now!):
- Get bluecove-2.0.1.jar (version as of 11/23/2007) from HERE
- if you have WinRAR on your desktop Windows machine, enter the WinRAR bluecove-2.0.1.jar command;
- otherwise, rename bluecove-2.0.1.jar to bluecove-2.0.1.zip and click it so that its content is shown;
- extract bluecove_ce.dll and intelbth_ce.dll from the root of the archive; transfer them to the \bin subdirectory of your IBM J9 installation.
Note that if you donít want to hunt for / extract these files yourself, Iíve made them available HERE as a standard ZIP file. Just unZIP it and transfer the two DLL's.
- copy bluecove.jar to the \lib\jclMidp20\ext directory of your IBM J9 installation. If ďextĒ doesnít exist, create it.
- youíll need to use special link files to start your Bluetooth-enabled MIDlets. This also means you donít need to deploy your MIDlets under J9 at all as direct links of this type donít require the MIDlets to be deployed beforehand. A typical link file looks like this:
255#"\Storage Card\ibm\bin\j9.exe" -jcl:midp20 -Dmicroedition.connection.pkgs=com.intel.bluetooth -cp MIDletName.jar "-jxe:\Storage Card\ibm\lib\jclMidp20\jclMidp20.jxe" MIDletName.jad
(An example link file is HERE as a real file.)
In here, change MIDletName to the filename of the MIDlet and, of course, change \Storage Card\ibm to the actual path of your IBM J9 installation.
Note that youíll also need the JAD files in this setup. Should you not have them, use the free JADMaker
to create them from JAR files (see the link for more info). If you donít provide any absolute directories in the link file to the JAR / JAD files, then, youíll need to copy the JAR file to the \lib\jclMidp20\ext directory of your IBM J9 installation before invoking the MIDlet through the link file. This is the same directory where bluecove.jar
should reside. Also, the JAD file must be in the same directory as the lnk file itself.
2. Some additional hacking
2.1 Nokia classes missing in the game
If you try to run 3D Constructo Combat under J9 (Iíll elaborate on other MIDlet managers later), youíll notice at once it doesnít run. The sole reason for this is the lack of some Nokia-specific libraries in the MIDlet manager. You can, however, easily ďhackĒ these classes into the JAR file of the MIDlet itself.
To do this, first, download THIS
archive and unZIP it. Second, get WinRAR and, after installing it, enter the WinRAR jarfilename command to open the JAR (the main MIDlet) file. Now, just drag-and-drop the com directory (with all its subdirectories, of course) to the opened JAR file Ė making sure you donít drop it on a directory, but in the root.
Thatís all; now, your MIDlet might start.
Note that this definitely works with 3D Constructo Combat and J9 but will NOT work with Jbed, not even with the permission hacking Iíll explain in the following section.
(also see THIS
Russian-language post for more info if interested. It doesn't contain much additional info, though.)
2.2 Permission hacking
As has been explained in the MIDlet Bible, some (very few!) MIDlets canít even be deployed under Jbed (and other, less recommended) MIDlet managers. The reason for this is the deployment-time permission checking.
An example of these MIDlets is 3D Constructo Combat, which is refused to be deployed because of the unavailability of a library (here, a Bluetooth one):
You can easily help this and make MIDlets at least deployable
(being actually runnable
is another question). To do this, enter the WinRAR MidletFileName.jar
command and extract the META-INF\MANIFEST.MF
file. In there, look for the MIDlet-Permissions:
row. For example, with 3D Constructo Combat, itíll be the following:
MIDlet-Permissions: javax.microedition.io.Connector.bluetooth.client,j avax.microedition.io.Connector.bluetooth.server
Just delete it and overwrite the original META-INF\MANIFEST.MF
file with the new version, all this in the JAR file. Again, the new file no longer contains the MIDlet-Permissions:
row. Now, the MIDlet at least becomes deployable as can also be seen in THIS
screenshot. (This, again, doesnít mean Jbed will be able to run it as well. It wonít, not even with the above-explained Nokia class hack.)