• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use Bluetooth API JSR82

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, but impossible to access the link you gave me (wrong URL ?). What are the names of the books ?
Thanks
Chris
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Christoph Ehret
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic