天天看点

如何在Blackberry平台上运行J2ME程序

一般来说,虽然blackberry支持java程序,但还是有如下的一些小细节步骤。

1. Only few things need to be changed based on the orginial J2ME code. Implement the Grpahic Wrapper and InputListener Wrapper for the Blackberry platform, which means technically instead of extends from GameCanvas, extends from BlackBerryGameCanvas, and implements KeyListener.

2. add external library(net_rim_api.jar) in your WTK

3. Build the application and generate the .jar file

4. Using RAPC.exe in windows prompt command line, convert the midlet to a COD as follows, all on one line (might be easier to make a .bat file out of this)

e.g: rapc import="c:/Program Files/Research in Motion/Blackberry JDE 4.7.0/lib/net_rim_api.jar" codename=ProductName  -midlet  "ProductName.jar"

This will generate a "ProductName .cod" file

5. Using javaloader.exe from a windows prompt command line to upload the newly created COD file to your blackberry (in my case USB connection)

e.g: javaloader -usb load ProductName.cod   或者  javaloader -usb load ProductName.jad  (jad已经指向对应的cod了)

备注: 有些Blackberry device 在OTA下载方式下,对单个cod文件有大小限制,所以如果cod文件太大需要对其分解成多个cod文件才能进行下载。

方法如下:

1. rename "ProductName.cod" to any name you want, for example "1.cod"

2. extract it using 7zip/winzip(any extract software), it will extract the cod file into several cod files. naming from "ProductName-1.cod" to "ProductName-xx.cod" (the corresponding .jad will also reflect this change)

继续阅读