best bluetooth dongle+ bluetooth programming
hello ther.e.
can anyone suggest which bluetooth dongle to use with windows xp service pack 2 .. so that i could develop an on my pc...
my problem..
um designing an applicatoin which works over bluetooth but the dongle i stated with was MSI dongle which had overwritten windows bluetooth stack and my midlet couldnt detect the third party stack.. now um using trendnet dongle ..its working fine with windows.. but my applicaiton still dont detect it.. wats the problem.
im posting the code for bluetooth discovery .. tell me if it needs modificaiton..
plz reply..
thanx
------------------------------------------------------------------------------------------
import java.lang.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.bluetooth.*;
public class DiscoveryMIDlet extends MIDlet implements CommandListener,DiscoveryListener
{
private List deviceList;
private DiscoveryAgent agent;
public DiscoveryMIDlet()
{
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void startApp() throws MIDletStateChangeException
{
deviceList = new List("List of Devices",List.IMPLICIT);
deviceList.addCommand(new Command("Exit",Command.EXIT,1));
deviceList.setCommandListener(this);
Display.getDisplay(this).setCurrent(deviceList);
try
{
LocalDevice local = LocalDevice.getLocalDevice();
agent = local.getDiscoveryAgent();
}
catch(BluetoothStateException e)
{
throw new MIDletStateChangeException("Unable to retrieve local bluetooth device 1");
}
try
{
agent.startInquiry(DiscoveryAgent.GIAC,this);
}
catch(BluetoothStateException e)
{
throw new MIDletStateChangeException("Unable to start inquiry");
}
}
public void commandAction(Command c, Displayable d)
{
notifyDestroyed();
}
public void deviceDiscovered(RemoteDevice device, DeviceClass cod)
{
String address = device.getBluetoothAddress();
deviceList.insert(0,address + "-I", null);
}
public void inquiryCompleted(int type)
{
Alert dialog = null;
if(type != DiscoveryListener.INQUIRY_COMPLETED)
{
dialog = new Alert("Bluetooth Error",
"The inquiry failed to complete normally",
null,AlertType.ERROR);
}
else
{
dialog = new Alert("Inquiry Completed","the inquiry completed normally",
null,AlertType.INFO);
}
dialog.setTimeout(Alert.FOREVER);
Display.getDisplay(this).setCurrent(dialog);
}
public void servicesDiscovered(int transID, ServiceRecord[] record)
{
}
public void serviceSearchCompleted(int transID, int type)
{
}
}



