how can I connect the bluetooth device from my desktop java application?

681 views
Skip to first unread message

Sasi

unread,
Aug 26, 2008, 4:50:45 PM8/26/08
to bluecove-users

Hi-

I am working on Java desktop application using Bluecove 2.0.2. I am
able to discover the devices and search the services for the SPP
supported devices. Now I have the connection URL with me and need to
connect the device.

When I include the following line of code in Java applications, it
says that package does not exist.

import javax.microedition.io;

I don't have any problems for the following line that i included in my
application. That's becauseI added the BlueCove.jar file in my app.

import javax.bluetooth.*;

Can I use "import javax.microedition.io" for my desktop java
application to use StreamConnection class? Or Should I need use some
other classes to implement the connection to the Bluetooth device?

Please let me know what classes I need to use to make connection to
the Bluetooth device.

thanks,
Sasikumar.

Vlad Skarzhevskyy

unread,
Aug 26, 2008, 11:14:36 PM8/26/08
to bluecov...@googlegroups.com
This is offtopic. Please learn java first!
--
Vlad
Message has been deleted

Vlad Skarzhevskyy

unread,
Aug 27, 2008, 10:56:11 PM8/27/08
to bluecov...@googlegroups.com
You can use Any classes in java SE!
You can use javax.microedition classes provided by bluecove in java SE!
You can use all bluecove classes in java SE. But preferable you should
use only javax.microedition.*, javax.bluetooth.* and javax.obex.* !

I can't comment on how to use bluecove javax.microedition.io classes
in J2ME project
In java SE just add bluecove.jar to classpath

On Wed, Aug 27, 2008 at 4:40 PM, rnevet <rne...@gmail.com> wrote:
>
>
> I'll give you some pointers but you are really offtopic here.. this
> has no connection to bluecove..
>
> 1. you can't use javax.microedition classes in a J2SE application..
> you have to create a J2ME project for you client application then
> compile it and deploy it on the device.
> 2. If you think you need something out of javax.microedition classes
> in your application go read the docs again , you are basically wrong
> and just missed something.
> 3. check nokia developers forum for examples..
>
> Good Luck.

--
Vlad

Sasikumar Gandhi

unread,
Aug 28, 2008, 1:39:47 PM8/28/08
to bluecov...@googlegroups.com
Hi Vilad and rnevet-

I know that this is really offtopic here. But looking at your replies, It was really helpfull for me. Since It's realted to using bluecove  classes in my app, I asked this question in this group.

Finally  I figured that out how to use the javax.microedition classes in my desktop application to connect the bluetooth headset from my PC. I succeeded in both widcomm and Microsoft stacks using bluecove library in my java app.

I still have only one question.  When I used the following line in my code, it showed the package does not exist.

import javax.microedition.*;

But when I used the following lines in my code, it's happy.

import javax.microedition.io.StreamConnection;
import javax.microedition.io.Connector;

Can you please tell me why it's happy when I used the above code instead the previous line?

Even it's a java related, please clarify me.

thanks & best regards,
Sasikumar.

Nima Kaviani

unread,
Aug 28, 2008, 1:46:17 PM8/28/08
to bluecov...@googlegroups.com
you should simply go with

import javax.microedition.io.*;

you are missing "io" and thus referring to an incorrect package for your classes in your first import. However, your approach of importing individual classes is a better java programming practice I believe.
Reply all
Reply to author
Forward
0 new messages