File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes J2ME Interaction with C++ through KNI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "J2ME Interaction with C++ through KNI?" Watch "J2ME Interaction with C++ through KNI?" New topic

J2ME Interaction with C++ through KNI?

Justin Bojarski

Joined: May 07, 2003
Posts: 1
I have a rather complex question that I was hoping to get some help on. Specifically
it relates to the J2ME (Java 2 Micro Edition) and its interaction with other elements
within a mobile device. I have a project in which 2 levels of a device have to
communicate. The top layers will utilize J2ME as well as SyncML (a program for
Over the air provisioning of software within a mobile device). The bottom layer will
interact directly with hardware through C++ (most likely).
My question arises with developing this layer inbetween the J2ME and the C++. I
need them to be able to access eachother somehow within this environment. If I
were using regular Java 2, I'd most likely use JNI (Java Native Interface). However,
since I'm using J2ME, it comes with a scaled down version of JNI called KNI. What
I really need to know are the limitations of KNI? Can I access data and functions
within my C++ module from J2ME through KNI? What are the other restrictions
that KNI places on accessability and functionality?
Additionally, are there any other means of accomplishing this dialogue between the
J2ME and C++? Namely, what about the use of sockets (Java and C++ sockets to
share data? Can this be done) or through the use of shared memory?
If anyone has any info on the above or can point me in the right direction that would
be greatly appreciated. My e-mail address is
I agree. Here's the link:
subject: J2ME Interaction with C++ through KNI?