sabato, 18 aprile 2009

The j2me applications come with a pair of file: a jad and a jar file. The Blackberry devices require application in a particular format: .cod file. Here, we'll describe a fast procedure to obtain a cod file from your midlet.

Before proceed be sure you have installed the Blackberry JDE (downloadable from the Blackberry developer website: download here) and the Java SDK from Sun (download here).

Here you are the steps:
  • Move your JAD and JAR in the bin directory of the JDE installation folder (i.e. c:\program files\Research in Motion\Blackberry JDE 4.7.0\bin\ that will make easier the process from the command line);
  • Open a DOS shell windows, go to the bin directory mentioned before and call the RAPC command: rapc import="c:\Program Files\Research in Motion\Blackberry JDE 4.7.0\lib\net_rim_api.jar" codename=myMidelt -midlet jad=myMidlet.jad myMidlet.jar. Use the name of your application instead of the myMidelt used in the previously written command line
  • Now you have your cod file, use the javaloader (after you have linked your device to the pc through usb cable) to send the application to your phone: javaloader -usb load filename.cod


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 19:12 | Permalink | commenti
categoria:tipsandtricks, j2me, blackberry, application


martedì, 07 aprile 2009

One of the biggest challenge for a J2ME developer is keep the jar size of his applications as smaller as possible.

Adding new features and images to have a cooler application make the aim very difficult to achieve. There are best coding practices to reach the goal but sometimes have some software help is nice.

I have found this utility called KJar that recompress your jars giving a smaller size than with the normal jar utility. I'm using the utility after the obfuscation step for my J2ME applications. For one application I have of 290 kb, I reduced to 277 kb using KJar.

The syntax of the command to use is:

kjar [options] in.jar [out.jar]

The options are:

-s Adjust size in JAD file (if existing)
-u:url Add URL path to JAD MIDlet-Jar-URL parameter

Kjar is a windows command tool and it can be downloaded clicking here


Did you like the article? Buy me a coffee!

postato da: emanuelepec alle ore 17:52 | Permalink | commenti
categoria:tipsandtricks, j2me


Blogs Directory