aspose file tools*
The moose likes Java Micro Edition and the fly likes How to use Bluetooth API JSR82 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to use Bluetooth API JSR82" Watch "How to use Bluetooth API JSR82" New topic
Author

How to use Bluetooth API JSR82

Christoph Ehret
Greenhorn

Joined: Dec 30, 2002
Posts: 12
Hi,
I have to write an application that runs on OS X (and if possible on any other plateform) with Bluetooth and that should communicate to any bluetooth mobile a kind of menu where you can do some actions (something like Sallingclicker or Romeo for those who know). So I found the Bluetooth API JSR82; ok, nice, it is even a final release. I only found the sources, is this normal ? No package ? I compile the example PrintClient without problem, but it I try to run the application, I have the following error :
Exception in thread "main" java.lang.RuntimeException: Not Implemented! Used to compile Code
So I have a look at the sources in javax.bluetooth and oohhh surprise almost every method throws the following exception when used throw new RuntimeException("Not Implemented! Used to compile Code"); .
But in the other code examples I found on Benhui.Net or on Sun website, they nerver speak of such a thing.
So how can I test the application ? Have I downloaded the wrong thing ? What have I to do, because actually I am really stucked .
Thanks for your explanations and help.
Chris
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
never used those, so i'd have to say, run, do not walk to your local bookstore and get one of these two books:
http://www.amazon.com/exec/obidos/search-handle-form/ref=s_sf_b_as/104-2653734-5491156
Christoph Ehret
Greenhorn

Joined: Dec 30, 2002
Posts: 12
Sorry, but impossible to access the link you gave me (wrong URL ?). What are the names of the books ?
Thanks
Chris
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
The problem with the link is that it uses a reference to a previously made search -- those things aren't persisted for too long...
My guess would be that the books to look for are
Bluetooth for Java
Bluetooth Application Programming with the Java APIs


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
It is my understanding that the JSR 82 API is only a wrapper over the native bluetooth APIs. The "reference implementation" source code is only a placeholder for such methods. If you want to implement the JSR 82, you can take the source code and populate code into each method you want to support.
But for developers, the source code you downloaded is not very useful. You need a JSR 82 implementation specific to your platform. I think you will find that info in those two books.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
Christoph Ehret
Greenhorn

Joined: Dec 30, 2002
Posts: 12
Thanks for the reply. I must admit (perhaps I am wrong) that documentation on this topic is rather poor unfortunately. Of course, you find a lot of stuff for the midlets, but something rather simple (or at least it seems simpler than other cases) as a little app running on my desktop or labtop with Bluetooth and scanning for responding to requests from mobile devices, just nothing ... Perhaps things will change with these Books .
++
Chris
Christoph Ehret
Greenhorn

Joined: Dec 30, 2002
Posts: 12
The point is, that it seems that Apple has no JSR-82 Interface for the Bluetooth API ... So no Bluetooth support for Java on a Mac
So, let's try Obj-C ...
Chris
Julien Campana
Greenhorn

Joined: May 26, 2004
Posts: 1
Hi Christoph,

The jar File provided by Sun is ONLY a specification and not the implementation of this specification!

That's why most of the methods throw a RuntimeException!

Bluetooth require some system-specific drivers (drivers are provided by Mac OS X. Under linux, the BlueZ stack is the official stack).
If you want to use the JSR82 specification you must therefore look for an implementation that uses your system-stack.

If you want a stable and efficient implementation of JSR82, I suggest you to have a look at
http://www.avetana-gmbh.de/avetana-gmbh/jsr82.xml

Only the linux version is free. Otherwise, you will have to purchase a license.

Julien


Originally posted by Christoph Ehret:
Hi,
I have to write an application that runs on OS X (and if possible on any other plateform) with Bluetooth and that should communicate to any bluetooth mobile a kind of menu where you can do some actions (something like Sallingclicker or Romeo for those who know). So I found the Bluetooth API JSR82; ok, nice, it is even a final release. I only found the sources, is this normal ? No package ? I compile the example PrintClient without problem, but it I try to run the application, I have the following error :
Exception in thread "main" java.lang.RuntimeException: Not Implemented! Used to compile Code
So I have a look at the sources in javax.bluetooth and oohhh surprise almost every method throws the following exception when used throw new RuntimeException("Not Implemented! Used to compile Code"); .
But in the other code examples I found on Benhui.Net or on Sun website, they nerver speak of such a thing.
So how can I test the application ? Have I downloaded the wrong thing ? What have I to do, because actually I am really stucked .

Thanks for your explanations and help.

Chris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use Bluetooth API JSR82