you need to discover the other bluetooth devices (the slow bit)- when u have there addresses you
can connect to them- make one of the phones the host- then the others will join the host. its not that
tricky really. and yes theres not much info on this… best thing u can do is download the SonyEricsson
SDK for java (even if u have a nokia) there is a set of demos that shows u how to make a bluetooth
2 player game…
if u want to connect your phone to a PC u will need a bluetooth stack on the PC. This can be hassle
because they cost money (if u want one that works). but when u have a java bt stack its pritty much
the same as u would connect to the phone.
so you need to (on the host phone):
- extend a DiscoveryListener.
- make a LocalDevice localDevice = LocalDevice.getLocalDevice();
- make your DiscoveryAgent agent = localDevice.getDiscoveryAgent();
- next step is to start to discover devices: agent.startInquiry(DiscoveryAgent.GIAC, this);
- if u have extended the DiscoveryListener all its methords will start to get called.
- store the devices into a Vector (or whatever u like).
- look up the services that are avalible on the device use the UUID of:
UUID[] uuidSet = {new UUID(0x0003)};
- start a search: agent.searchServices(null, uuidSet, btDevice, this);
- when your client finds another phone with the service u want to comm over your ready
so the server (host):
- start a bluetooth server (bit like a serversocket but using bt).
pritty simple the server. but that should get u up and running… worked cool for me… oh and when u want
to connect and chat to the host just connect like this:
String url = serviceRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
conn = (StreamConnection) Connector.open(url);
output = conn.openOutputStream();
ps = new PrintStream(output);
hope that helps?