File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Bluetooth programming using J2SE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Bluetooth programming using J2SE" Watch "Bluetooth programming using J2SE" New topic
Author

Bluetooth programming using J2SE

Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Are there any J2SE API's that let you communicate directly with Bluetooth devices connected to your PC's USB port? Is there any guide/tutorial/book out there that deals with this subject?

Any sort of help would be greatly appreciated.


There is no patch for ignorance...
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3742
    
  16
This might be a good place to start.


Joanne
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by Joanne Neal:
This might be a good place to start.


Thanks for your quick response. I'll look into it and see how far I can go. But I'm still open to suggestions.
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Ok I downloaded BlueCove from here but I'm completely lost. They haven't provided any sort of documention or code samples in their home page. Can someone help me out here??
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

I successfully implemented what you are talking about some time back, but not without immense frustration. Here are the things you need...

1. Look at the Rococo , Avetana and Atinav stacks.

2. Get yourself a high quality dongle. May be a Compaq, HP, IBM dongle or some other branded dongle that these stacks are bound to recognize.

3. Make sure your target device can detect your dongle.

4. Make sure your target device can communicate with the protocol of you choice. Example... some phones dont support OBEX transfers.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by John Meyers:
I successfully implemented what you are talking about some time back, but not without immense frustration. Here are the things you need...

1. Look at the Rococo , Avetana and Atinav stacks.

2. Get yourself a high quality dongle. May be a Compaq, HP, IBM dongle or some other branded dongle that these stacks are bound to recognize.

3. Make sure your target device can detect your dongle.

4. Make sure your target device can communicate with the protocol of you choice. Example... some phones dont support OBEX transfers.


The problem with the Rococo, Avetana and Atinav stacks is that they're not free But I'll give'em a shot and if everything works may be I'll consider buying them.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Yep ! But you can use the evaluation version to see if it will work out for you.
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
@see http://wiki.java.net/bin/view/Javapedia/Bluetooth
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Ok has anyone tested the Atinav API with a Gigabyte Bluetooth dongle; the only brands that are available in my country are: Gigabyte, Winstar & Billionton. So which one should I buy??
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Gigabyte, Winstar & Billionton


Ahhhh sadly these are not available in my country ( as far as i know ). Have a look at the ini files to see which dongle is supported. Atinav or Avetana has an ini file that defines the supported branded dongles. There is a default support if it detects none. I had to experiment with 3 dongles. I bought one, my friend bought the other and the third one came in a lap top. Fortunately two out of three worked. They were COMPAQ and blue soleil dongles.

Here is what i suggest:

1. Buy the one you think will do best first. Make sure that it can communicate with your phone. Then write the code that hosts the transfer protocol of your choice.

2. Dont stop if one of your protocols fail. I think the L2CAP and RFCOMM protocols failed in my case. Keep trying until you can successfully host.

3. Test successfull bluetooth hosts on your computer, by scanning for bluetooth devices and services from your phone.

4. Dont ever give up. Keep trying. Its a good experience. You end up with a fractured skull but the bright side is that your brain can now expand
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by John Meyers:

They were COMPAQ and blue soleil dongles.


Winstar & Billionton use drivers & softwares made by IVT Blue Soleil. Will that do?
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Ok I found the following lines in the ini file found under \Atinav\J2SE USB\aveLinkBT\USB DRIVER:


So doz dat mean Atinav will support Billionton!!!
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Ok I've installed the Atinav AveLink Bluetooth driver for my bluetooth device and everything is ok.. When I run the client.jar sample app, my cell phone is able to detect my bluetooth device as 'AveLink_Bluetooth_Device' when I scan for devices. So that means everything is ok right? So now how do I trnasfer files, send messages etc?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Cool ! now that your cell phone can detect your USB dongle... write code that will host a service on that dongle. This is a bit tricky. You will have to utilize the L2CAP or RFCOMM or OBEX protocols to communicate via the bluetooth channel. If your phone supports OBEX i would suggest you use this protocol to transfer files. Have a look at this book...

http://www.amazon.com/Bluetooth-Java-Bruce-Hopkins/dp/1590590783

Chapter seven talks about Java and OBEX.
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by John Meyers:
Cool ! now that your cell phone can detect your USB dongle... write code that will host a service on that dongle. This is a bit tricky. You will have to utilize the L2CAP or RFCOMM or OBEX protocols to communicate via the bluetooth channel. If your phone supports OBEX i would suggest you use this protocol to transfer files. Have a look at this book...

http://www.amazon.com/Bluetooth-Java-Bruce-Hopkins/dp/1590590783

Chapter seven talks about Java and OBEX.


I want to be able to send files/messages using the Atinav API but where is there API?? Also, before I buy their API I want to test it out. So how can I do that using their demo application?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

Here is what i can remember...

Atinav makes you install the USB dongle with its own driver. That means the USB dongle will be controlled by the atinav dll. The product can be downloaded from this page...

http://www.avelink.com/asp/indexB.asp?suite=B

Use the avelink sdk for J2SE. It can be evaluated for 15 days

The Avetana guys make you register the API with a specific bluetooth address. So the stack will work only on a particular dongle. Find the bluetooth address of your dongle by looking up on its hardware properties.
Get Avetana here...

http://www.avetana-gmbh.de/avetana-gmbh/produkte/jsr82.eng.xml

All stack implementations use the JSR82 spec and make them J2SE compliant. Look up bluetooth code here...

http://www.java-tips.org/java-me-tips/midp/
Stuart Ash
Ranch Hand

Joined: Oct 07, 2005
Posts: 637
A curiosity: since USB is a standard, I wonder why the Java team did not come up with a javax.usb API.

Has there been any discussion of any such thing that someone here knows of?

Cheers.


ASCII silly question, Get a silly ANSI.
Mamu Jan
Ranch Hand

Joined: Sep 21, 2005
Posts: 45
Originally posted by Stuart Ash:
A curiosity: since USB is a standard, I wonder why the Java team did not come up with a javax.usb API.

Has there been any discussion of any such thing that someone here knows of?

Cheers.


Yes there are documentations out there for JSR80 which is the Java Specification Request concerned with communication with Universal Serial Bus(USB)devices.
evil genius
Greenhorn

Joined: May 24, 2009
Posts: 3
the avetana website for bluetooth API is not accepting my bluetooth device address i need it what should i do please help me
evil genius
Greenhorn

Joined: May 24, 2009
Posts: 3
please if any one can help me out i would be thankfull please i need it
evil genius
Greenhorn

Joined: May 24, 2009
Posts: 3
if any one has any idea please let me know please i am working on pc and mobile communication via bluetooth i need it its urgent please
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

1) Please read your private messages regarding an important announcement.
2) Use the Edit button to modify your post if you need to add anything.
3) http://faq.javaranch.com/java/PatienceIsAVirtue - 2 hours without a reply does not warrant a kick
4) http://faq.javaranch.com/java/EaseUp - no need to inform us it's urgent. We're not going to find a solution any faster, as we are all volunteers
5) http://faq.javaranch.com/java/DontWakeTheZombies - this thread was over 2.5 years old


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
ashjo sharma
Greenhorn

Joined: Feb 06, 2011
Posts: 1
evil genius wrote:if any one has any idea please let me know please i am working on pc and mobile communication via bluetooth i need it its urgent please


Did you find the reason why they were not accepting your Bluetooth address. I am also getting same problem
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19784
    
  20

Our "evil genius" hasn't been active on the Ranch since these three posts, so I wouldn't expect an answer from him/her.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bluetooth programming using J2SE