×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    43

    listing the bluetooth devices

    I want to search the devices nearby and show the list.
    The devices has been always searched and Whenever there is a new device, it will be added to the list and whenever a device is not nearby, it will be removed from the list.
    How can I do that?
    And which I should use?( for example, textfield, alert)

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: listing the bluetooth devices

    Quote Originally Posted by gracy View Post
    I want to search the devices nearby and show the list.
    The devices has been always searched and Whenever there is a new device, it will be added to the list and whenever a device is not nearby, it will be removed from the list.
    How can I do that?
    And which I should use?( for example, textfield, alert)
    Please note that Because wireless devices are mobile they need a mechanism that allows them to find other devices and gain access to their capabilities. The core Bluetooth API's DiscoveryAgent class and DiscoveryListener interface provide the necessary discovery services.

    A Bluetooth device can use a DiscoveryAgent object to obtain a list of accessible devices, in any of three ways:

    The DiscoveryAgent.startInquiry method places the device into an inquiry mode. To take advantage of this mode, the application must specify an event listener that will respond to inquiry-related events. DiscoveryListener.deviceDiscovered is called each time an inquiry finds a device. When the inquiry is completed or canceled, DiscoveryListener.inquiryCompleted is invoked.

    If the device doesn't wish to wait for devices to be discovered, it can use the DiscoveryAgent.retrieveDevices method to retrieve an existing list. Depending on the parameter passed, this method will return either a list of devices that were found in a previous inquiry, or a list of pre-known devices that the local device has told the Bluetooth Control Center it will contact often.

    DiscoveryListener interface should be implemented for any bluetooth program written in Java.

    Following are the methods that should be overridden while implementing the DiscoveryListener.

    public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass deviceClass) - A device is discovered
    public void inquiryCompleted(int param) - Inquiry for bluetooth enabled and discoverable is completed
    public void serviceSearchCompleted(int transID, int respCode) - search for services of a discovered device completed
    public void servicesDiscovered(int transID,ServiceRecord[] serviceRecord) - a service is discovered for the device
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: listing the bluetooth devices

    There is no ready API that can be used to get such notification, you can build your own class by yourself. For example search devices time to time and check if it is found and if it is not found you can tell your UI to remove it from the list.

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Re: listing the bluetooth devices

    gracy, because Symbian caches found Bluetooth devices you can forget that project.

Similar Threads

  1. Bluetooth API not listing paired devices in Java ME
    By harriskorn in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2010-01-22, 09:15
  2. Listing bluetooths devices running same application
    By rdiniz in forum Bluetooth Technology
    Replies: 3
    Last Post: 2009-01-04, 18:45
  3. devices command not showing S60_2nd_FP2_MIDP device in the listing?
    By SanjayKhuntia in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2008-09-01, 15:53
  4. Bluetooth Devices
    By PyNewbie08 in forum Symbian
    Replies: 11
    Last Post: 2008-08-10, 06:41
  5. [Moved] bluetooth application for nokia bluetooth capable devices
    By cutescar2nis in forum Bluetooth Technology
    Replies: 2
    Last Post: 2008-08-05, 09:23

Posting Permissions

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