Q about Wireless Toolkit and native code

D

Daniel

Hi all!

Suppose I want to create and distribute a library for use with Sun's
wireless toolkit. The library consists of a number of Java classes and
a DLL containing some native code. Is this possible at all? I know of
the following problems:

* The KVM doesn't support JNI. However, my understanding is that the
emulator in WTK uses the J2SE VM, so it should be possible anyway.

* The preverifier fails for classes using native declarations. But
mustn't the WTK itself use some native code? And there should be no
reason for this code to be pre-verified as it's runnning in the J2SE
VM. Correct? The question is, how can I add this kind of code to the
WTK?

I hope I'm making myself understood. :) Any help or thoughts about this
would be very appreciated. Thanks in advance!

/Daniel
 
R

Roedy Green

* The preverifier fails for classes using native declarations. But
mustn't the WTK itself use some native code?

JNI is more than just native classes. It is a library of methods you
can call from C. It is the javah utility. It is a set of C headers.
It is a bunch of glue for hooking up JNI. I would hope the built-in
native classes go through a more efficient mechanism than JNI that
does not require runtime hookup.
 
D

Darryl L. Pierce

Daniel said:
Suppose I want to create and distribute a library for use with Sun's
wireless toolkit. The library consists of a number of Java classes and
a DLL containing some native code. Is this possible at all?

Why not just use the MIDP reference implementation, which comes with
source code and which can be used (once you've licensed it) to make a
customized MIDP environment as you're desiring.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top