Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 944
  • Last Modified:

How to extend J2ME capabilities (eg, Bluetooth API) without access to JNI?

Ok - I need a real expert here, please bear in mind I've been doing J2ME on and off for about 4 years now, so I know a reasonable lot about the matter.

Here's the problem - I need to access Bluetooth devices on a particular phone (namely, XDA/SPV type devices) but the intalled KVM (namely, the crappy Intent JVM by Tao) does not support the Bluetooth API (JSR-82, I believe).

I would have no problem in writing the necessary C++ (native) classes/code to provide the functionality (in fact, I did exactly that for the iPaq to connect to a GPS bluetooth)


J2ME does not support JNI - so, how does one enable the connectivity?  unless I am the phone manufacturer or the KVM writer.

I suppose one solution would be to write a "localhost" on the native side and connect to it from the JVM, but (a) this would not be really compliant with JSR and (b) I shudder thinking writing a server using Win32....

Any suggestions?

Many thanks,
  • 2
  • 2
1 Solution

 I am working in the same field for 5 years. When I saw your problem.. I thought only one answer. That is NO you can not access.

 If the JVM (or KVM) does not support the native calls of Blue tooth using KNI (similar to JNI), there is no way a application can access blue tooth using the JAVA Application.

 For Application ot use Blue tooth, the VM should suport Blue tooth classes either by JSR or by Native implementaion supprt by KNI.

Without that, I am afriad you can not do it.

If anybody have other way of doing please let us know.. we need it..

massenzAuthor Commented:
Sreenath - well, thanks... a bit disappointing, really...

anyone from Sun here?
is this THE single most serious shortcoming of J2ME?

As far as I know.. If JVM (or KVM) does not support functionality either in the VM or in JSRs or in Native inplementation, we can not do anything with the application.

massenzAuthor Commented:
Well - after further investigation, it turns out that, sadly, it is NOT possible to extend in ANY WAY the KVM capabilities if CLDC config is supported

HOWEVER, if CDC config is supported, then JNI apparenly is available (eg one of the SonyEricsson model provides it) and then JNI can be used.

Not great, really - but that's life, I suppose.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Building an Effective Phishing Protection Program

Join Director of Product Management Todd OBoyle on April 26th as he covers the key elements of a phishing protection program. Whether you’re an old hat at phishing education or considering starting a program -- we'll discuss critical components that should be in any program.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now