Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2005

    Nokia 6680 Java Bluetooth problem, not finding any devices

    Hi all!

    I'm trying to do a basic Java client-bluetooth application with JSR-82.
    It is a starndard "of the school-book" exampel app. that starts a inquire and print the information found.
    So far so good, everything starts like it should, but the app. doesn't find any devices!

    The app. works just fine in the emulators (and emulators with bluecove, finding real devices) and on a Sonyericsson k750i.
    The Nokia I'm using is a 6680 of the shelf.

    Any ideas whats wrong?

    Here is the code:

    public class BT implements DiscoveryListener {
        private LocalDevice device;
        private DiscoveryAgent agent;
        private Vector remoteDevices = new Vector();
        private TT cm;
        public static final UUID uuid = new UUID(
                "27012f0c68af4fbf8dbe6bbaf7ab651b", false);
        BT(TT cm) {
            this.cm = cm;
            try {
                device = LocalDevice.getLocalDevice();
                agent = device.getDiscoveryAgent();
                cm.msg("** Start Inquire");
                agent.startInquiry(DiscoveryAgent.GIAC, this);
            } catch (Exception e) {
        private void searchServices(RemoteDevice remoteDevice) {
            try {
                agent.searchServices(new int[] { 0x0100, 0x0101 },
                        new UUID[] { uuid }, remoteDevice, this);
            } catch (BluetoothStateException e) {
        private void connectServices(ServiceRecord service) {
            System.out.println("** " + service.getAttributeValue(0x0100));
            try {
                StreamConnection connection = (StreamConnection) Connector
                                ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false));
                DataOutputStream dos = new DataOutputStream(connection.openOutputStream());
                dos.writeUTF("abc 123\nåäö 123");
            } catch (Exception e) {
        public void deviceDiscovered(RemoteDevice remoteDevice,
                DeviceClass deviceClass) {
            try {
                String msg = "** Device found!\n" + "Friendly name: "
                        + remoteDevice.getFriendlyName(true) + "\n"
                        + "Device klass: " + deviceClass + "\n" + "BT Adress: "
                        + remoteDevice.getBluetoothAddress();
            } catch (IOException e) {
        public void servicesDiscovered(int arg0, ServiceRecord[] arg1) {
            cm.msg("** Service discovered");
            for (int i = 0; i < arg1.length; i++) {
        public void serviceSearchCompleted(int arg0, int arg1) {
            cm.msg("** Service search complete");
        public void inquiryCompleted(int arg0) {
            cm.msg("** Inquiry complete");
    Ps. the code have some searchSearch(), connectService() functions that works well on the other devices (i.e. emulator, k750i). But on the Nokia it never even reaches the deviceDiscovered() function.

  2. #2
    Registered User
    Join Date
    Sep 2005

    Re: Nokia 6680 Java Bluetooth problem, not finding any devices

    The problem was that the phone couldn't handle concurrent inquiries and searchServices calls. The phone actually found the devices but throwed some "Busy" exceptions which I didn't handle properly.
    The solution was to queue it up and run it synchronized.

    I found some pretty good examples:

    Btw, remember to check all exception thrown, it will make the debuging alot easier :-P

Similar Threads

  1. Nokia 6620, Bluetooth, & Java
    By kaycookie in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-10-15, 17:48
  2. Problem with sending SMS in Nokia 3200 from Java app
    By destroyer2003 in forum General Messaging
    Replies: 0
    Last Post: 2004-09-22, 12:12
  3. Nokia Comunicator 9500
    By alvisone in forum General Development Questions
    Replies: 2
    Last Post: 2004-03-01, 07:01
  4. Nokia 7650 support Bluetooth audo?
    By ovjo12 in forum Bluetooth Technology
    Replies: 5
    Last Post: 2003-07-17, 18:50
  5. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts