Question

Is there any way to write a MIDlet, but still use BlackBerry API classes and functions (including the APIs that require code signing)?

In particular, I'm trying to use Kuix (http://www.kalmeo.org/projects/kuix). A pure MIDlet + Kuix (so without BlackBerry stuff) works perfectly after I converted the jar/jad to a cod file.

As soon as I add BlackBerry API-stuff (CoverageInfo.COVERAGE_DIRECT in this case) I get a verification error when trying to run the cod file:

Error starting $name: Module $name has verification error 2410 at offset 9a4f

What can I do to solve this?

Was it helpful?

Solution

I guess you have to convert jar into cod (as you did) and maybe sign it.

BB Developer Tutorial C40 Using MIDLets on BlackBerry :

Without a doubt, additional RIM APIs give developers much more flexibility and the ability to provide customized functionality for their BlackBerry applications. Existing MIDLets can be used as is on BlackBerry Smartphones or they can be enriched by adding BlackBerry specific features.
On the other hand applications customized for BlackBerry will not work on other platforms, and if portability is of major concern, RIM APIs should not be used, or you can opt to have two builds: one for BlackBerry and one for all other J2ME devices. Even if portability is a concern, you can see how easy it is to add some BlackBerry specific features, and I highly recommend doing so.
At the end of the day there are three options you can choose:
1. Run an existing J2ME (JAR file) application on BlackBerry
- a. No cost
- b. Problems with permissions and not optimized user experience
2. Convert the JAR file into COD and sign the application
- a. Virtually no cost – Code Signing Keys cost about 20USD
- b. No issues with application permissions, but still problems with non-optimized user experience
3. Converted and Signed OPTIMIZED application
- a. Very short development time – Usually couple of days
- b. Much better overall user experience.

See also A60 How And When To Sign

OTHER TIPS

Here is the full documention from RIM on Midlet

In Midlet application some of the BlackBerry API is not availlable, you will need to build a CLDC application to use them.

I agree with Max, the only point I would add here is that all blackberry API's except the one related to UI can be used in a Midlet. The LCDUI and Blackberry Native UI cannot be used together in an application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top