Hello everybody,
I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...
I have searched the net looking for a way to do it, but didn't find one. :confused:
Is it possible to develop such application? If so, how can I do it? What should I look for? Is Java the ideal language for this application? (I don't care to use C# or C++ instead...)
Thanks.... :o
PC application with bluetooth
Started by urip, Jan 26 2008 08:19 AM
5 replies to this topic
#1
Posted 26 January 2008 - 08:19 AM
|
|
|
#2
Posted 26 January 2008 - 10:25 AM
That's an interesting question. I haven't program anything like that but I found some information for you (and for my own enjoyment :D). Apparently Java provides an API to interact with bluetooth devices on the package javax.bluetooth. You can find the information here: Using the Java APIs for Bluetooth Wireless Technology
#3
Posted 26 January 2008 - 12:38 PM
monkey_instinct said:
That's an interesting question. I haven't program anything like that but I found some information for you (and for my own enjoyment :D). Apparently Java provides an API to interact with bluetooth devices on the package javax.bluetooth. You can find the information here: Using the Java APIs for Bluetooth Wireless Technology
:rolleyes: How didn't I find this one? Seems like a very good place to start from...
Thank you very much ;)
#4
Posted 13 February 2008 - 06:08 AM
Well, after a lot of work, using bluecove (jsr-82), I've succeeded in making a device discovery search, select a mobile phone, search for services and make a connection attempt..
So far so good, but when I try to connect the mobile, my cell demands a passkey (in order to pair itself to the PC).
So I have two questions (I've listed some code in the bottom):
1. Is it possible to send a message without the passkey and the pairing? (only by clicking yes/no to accept the connection by the cell) For instance, when I send a file from one mobile phone to another, it doesn't request a passkey, only an approval from the mobile user. How is it done?
2. If it's not possible to connect without the passkey, how do I enter the pairing passkey back in the PC?
This is how I'm trying to initialize the connection:
I hope I explained the code enough
Thanks
So far so good, but when I try to connect the mobile, my cell demands a passkey (in order to pair itself to the PC).
So I have two questions (I've listed some code in the bottom):
1. Is it possible to send a message without the passkey and the pairing? (only by clicking yes/no to accept the connection by the cell) For instance, when I send a file from one mobile phone to another, it doesn't request a passkey, only an approval from the mobile user. How is it done?
2. If it's not possible to connect without the passkey, how do I enter the pairing passkey back in the PC?
This is how I'm trying to initialize the connection:
...
//after finding the remote device...
int[] attrSet = new int[] { 0x0100};
UUID uuidSet[] = new UUID[] { new UUID(0x1106) };
int bl = _discoveryAgent.searchServices(attrSet, uuidSet, devices[i], this);
...
public void serviceSearchCompleted(int transID, int respCode)
{
if(respCode == SERVICE_SEARCH_COMPLETED)
{
try
{
//servRecord holds the found ServiceRecord
String connectionUrl = servRecord[0].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
StreamConnection streamConnector = (StreamConnection) Connector.open(connectionUrl);
String msg = "Success.";
OutputStream os = streamConnector.openOutputStream();
os.write(msg.getBytes());
streamConnector.close();
}
catch(Exception exc)
{
System.out.println("Error occured: " + exc);
}
}
}
I hope I explained the code enough
Thanks
#5
Posted 13 August 2008 - 06:24 AM
Hello!!!
I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...
I have searched the net looking for a way to do it, but didn't find one.
Since(As,Like) devices discover?? Where I specify that I use the port USB?? Do I need contacarme with the person that it(he,she) did the miracle of the application??
[SIZE="5"]HELP!!!![/SIZE]
I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...
I have searched the net looking for a way to do it, but didn't find one.
Since(As,Like) devices discover?? Where I specify that I use the port USB?? Do I need contacarme with the person that it(he,she) did the miracle of the application??
[SIZE="5"]HELP!!!![/SIZE]
#6
Posted 13 August 2008 - 06:28 AM
[quote name='sasha']Hello!!!
I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...
I have searched the net looking for a way to do it, but didn't find one.
As devices discover?? Where I specify that I use the port USB?? Do I need to contact myself with the person who did the miracle of the application??[SIZE="5"]HELP!!!![/[/SIZE]
I'm trying to develop a PC application with a Bluetooth connection using a USB dongle.
The application is supposed to search for devices in range, choose one of them, and then send him a file...
I have searched the net looking for a way to do it, but didn't find one.
As devices discover?? Where I specify that I use the port USB?? Do I need to contact myself with the person who did the miracle of the application??[SIZE="5"]HELP!!!![/[/SIZE]


Sign In
Create Account

Back to top









