Bluetooth: Application does not wait for investigation

Good afternoon

For almost a week already had a problem, which already has a load of messages on the forum, after research and do the trial & error for three days, I hope someone can relate to no doubt tiny stupid error I have and I just can't.

The goal is simple: Once loaded, begins to discover Bluetooth lights nearby.

Problem: The tags are located and what is work decently, but he does not obey the synchronization (wait/notify).

I tried several things, but I keep hitting the same problem. It does not take into account my lock and did the survey on the bottom, and only after main thread finished drawing.

To facilitate the access to tests, I've isolated the problem section.

// Does Not wait for Inquiry to end!

The solutions tried so far:

-Temporary "fix" sleep vs sync

S ' object in static final or none and that any combination of the three options.

-Develop a 9700 OS 6 SDK: 6.0.0.30 Plugin Java: 1.3.0

import java.util.Vector;

import javax.bluetooth.BluetoothStateException;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;

import net.rim.device.api.ui.component.AutoTextEditField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;

public class MyScreen extends MainScreen
{
    Vector tags = new Vector();
    private Object lock=new Object();

    public MyScreen() throws BluetoothStateException
    {
        super();
        setTitle("Bluetooth Discover");
        Listener myDiscoveryListener = new Listener();
        try
        {
           LocalDevice localDevice = LocalDevice.getLocalDevice();

           DiscoveryAgent discoveryAgent = localDevice.getDiscoveryAgent();

           discoveryAgent.startInquiry(DiscoveryAgent.GIAC, myDiscoveryListener);
        }
        catch(BluetoothStateException bse)
        {
            Dialog.alert("BluetoothStateException exception: "+bse.toString());
        }
        // Does Not wait for Inquiry to end!
        try
        {
            synchronized(lock)
            {
                lock.wait();
            }
        } catch (Exception e) {}
        Vector tags = myDiscoveryListener.mac;
        String text="";
        for (int i=0; i

import java.util.Vector;

import javax.bluetooth.DeviceClass;
import javax.bluetooth.DiscoveryListener;
import javax.bluetooth.RemoteDevice;
import javax.bluetooth.ServiceRecord;

public class Listener extends Thread implements DiscoveryListener
{
    Vector mac = new Vector();
    private Object lock=new Object();

    public Listener()
    {
    }

    public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass cod)
    {
        try
        {
            System.out.println("Device: " + remoteDevice.getBluetoothAddress());
        } catch(Exception e){ } finally{ mac.addElement(remoteDevice.getBluetoothAddress().toString()); }
    }

    public void inquiryCompleted(int discType)
    {
        if (mac.size() > 0)
        {
            try
            {
                lock.notifyAll();
            } catch (Exception e){}
        }
    }

    public void servicesDiscovered(int transID, ServiceRecord[] servRecord)
    {
    }

    public void serviceSearchCompleted(int transID, int respCode)
    {
    }
}

Thanks in advance for all the help possible and yes I am services that support are not being implemented are not necessary for the current problem that prevents me to further develop my application.

PF

I have the same problem before and still can't fix. I don't know, but it seems that there is a problem in the 9700 OS.

http://supportforums.BlackBerry.com/T5/Java-development/BB-Bluetooth-connection-cannot-act-as-client...

In any case please inform me if there is good new ants on this issue.

Thanks in advance.

Best regards

Albert Siu

Tags: BlackBerry Developers

Similar Questions

  • Delete record behavior does not wait for the "submit" button

    I have master / detail pages as a whole.  Of all the detail, there are links to delete or update a record.  When I click the link to delete the folder, it goes to the confirmation page with the correct record.  Now, when I add the behavior delete record server and a button "submit", it is what is happening.  As soon as I click on the link to access the Delete Confirm page, deletes the record and the page redirects to the page that I put in the server behavior.  It does not display the confirmation page and does not wait for me to hit the button confirm.  The page runs and removes the page from the database.

    How can I get to wait until I hit the submit button?

    You must surround your request deletion with an "If" statement seeking a confirmation variable, then when the user clicks the confirmation link, you can pass the necessary variable and the ID of the record that the delete request is pregnant.

    As an alternative, you can use a JS alert fuction to ask if they are sure they want to delete the folder, and then delet allwo runs after confirmation to the user. To do this, you can use code like this...


    onclick = "return ('are you SURE you want to DELETE this record? confirm")">

    --
    Lawrence * Adobe Community Expert *.
    www.Cartweaver.com
    All Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF
    www.twitter.com/LawrenceCramer

  • HP laserjet 1022 does not wait for the user to turn the pages when printing double-sided

    My Hp laserjet 1022 printer working properly for years.

    So far, when he executed more paper he tried a couple of times to get more paper and then stops with a message on the PC it is out of paper.

    Very annoyingly, this has changed recently, now when it is out of paper, he tries a couple of times to get more paper and watch the message on the PC, saying that it is paper and then again, try a couple of times to get more paper and again shows the same message on the PC and him back... This continues to go on and on.

    It's especially annoying when trying to print double-sided. Before he used to stop and ask you to turn the pages to print the other side. Now the previous behavior overrides the break to turn the pages and keeps it will try to get more paper. As now, it does not wait for the user to turn the pages, in general it spoils the impression out by getting another paper that is not what I wanted, he drives me crazy! It's really hard to print anything double face now.

    All solutions?

    Operating system is Windows 7, I just downloaded and installed the latest driver for this printer "2013-01-09, Version: 20120918" and I get the same behavior. In the properties of the printer that I put some State Messages to Off and at least I don't get the full windows message screen poping up every time the printer is trying again to get more paper. I have not found all the other parameters that may affect this behavior.

    Help!

    Hello

    I solved the problem! I found the original CD for the printer. I uninstall the current driver and then install CD and now when the printer is out of paper trying to get paper a couple of times and then stops, as it used to be.

    Thanks for your help.

    Martin

  • HumanTaskActivity does not wait for the user to act

    Hello

    Proc2 I stole the activity of each of the branches, I invoke another process called PROC3 from the e-mail as PROC3 entry.

    PROC3 contains only HumanTaskActivity.

    By the time wherever I start my PROC2, he calls PROC3, but in HumanTaskActivity PROC3 does not wait for the response, it gets full without sending email.

    Any help would be very handful for me.

    Thank you
    VIKI

    VIKI,

    You can run just PROC3? It work? Except that there is a problem with the assignment of the user / group in this task? Users of human tasks has the correct permissions / roles?

    Marc

  • SRM does not wait for the guests of the DPM enabled

    Hello

    We are testing our environment vsphere 5/SRM and essentially 5, everything goes very well except for wake up initiated by the SRM to the DPM active guests.

    --------------------------------

    The SRM 5.0 doco States:

    SRM temporarily disables DPM for the cluster, and ensures that all guests there are lit before recovery begins. After the recovery or the test is completed, SRM reactive DPM for the cluster, but it hosts are found in the current state of execution while DPM is able to feed them downwards as needed.

    --------------------------------

    The question that we see is that SRM send indeed wake up for guests in mode standby and milestone of recovery as a success. The problem is that SRM does not wait until the guests are completely turned on before before feeding on the VMs. The day before hosts to wake the system correctly storage access newly presented no problem. The problem is that the bubbles to test network is not created on the hosts of the day before and no VMs are assigned to these hosts during the entire test.

    That said, I checked the advanced settings and I cannot find a setting that will force SRM to wait for the standby hosts to be fully integrated in the cluster before you perform additional steps.

    Everyone knows this behavior? Am I missing a setting somwhere? My fear is that this behavior will happen during a real failover and potentially cause problems.

    Thank you for your time,

    Smokey

    Hello

    This should not happen.

    Can you please open a SR, download bundle Journal, engineers will be able to understand what is happening?

    Once you open a case, display the number of SR.

    Michael.

  • my bluetooth application does not work

    I would like to ask how to run my application bluetooth in my acer netbook.  I had been through the msg will appear on the screen saying RUN... but still does not work. I wanted to send music from my phone to my netbook but its not working... pls hepl me I do not know how to handle fixing it... Thank you and looking forward to hear from you.

    Hello

    Thanks for posting the request in the Microsoft community!

    I imagine the inconvenience that you are experiencing. I will certainly help the question of fixing.

    1. what happens when you try to send music from a mobile phone?
    2. you receive an error message?

    Method 1:
    To do this, you must control how pairs with the computer (which connects to) Bluetooth devices. To control how your computer pairs with Bluetooth devices

    a. open Control Panel by clicking the Start button, then Control Panel.

    b. in the search panel box command, type Bluetooth, and then click change Bluetooth settings.

    (c) in the Bluetooth settings dialog box, click the Options tab and do one of the following:

    · Pour rendre make your computer discoverable to Bluetooth devices, select the check box for Allow Bluetooth devices to find this computer.

    When a computer active Bluetooth device is in discoverable mode, it broadcasts a wireless signal that allows it to be detected by other Bluetooth compatible computers or devices. This is sometimes called pairing mode.

    · To allow Bluetooth devices to connect to your computer, select the check box for Allow Bluetooth to connect to this computer devices.

    · To be notified when a Bluetooth device is trying to connect to your computer, check the box for warn me when a new Bluetooth device wants to connect.

    See the link to add the Bluetooth on the computer.

    http://Windows.Microsoft.com/en-us/Windows7/add-a-Bluetooth-or-other-wireless-or-network-device-frequently-asked-questions

    http://Windows.Microsoft.com/en-us/Windows7/add-a-Bluetooth-enabled-device-to-your-computer

    Method 2:
    You can update the latest drivers for Bluetooth and the software on the manufacturer's Web site and check.

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Check out the link:
    http://support.Acer.com/product/default.aspx

    Please post if the problem persists, we will be happy to help.

  • SonicWall UI Analyzer does not - waiting for localhost

    I have SonicWall Analyzer installed and configured on a Windows Server 2012 Essentials. It was working fine for months and then quit one day. I think that he might be left after installation of Windows updates and reboot, but I don't know what got updates installed.

    I get to the screen (using Chrome) that says: "your connection is not private. I chose to show advanced and then click on "Proceed to localhost (dangerous)" and after that he sits and pretended to load indefinitely. He never expire error on our part, I saw that. The URL in my browser is localhost:8071/MBS/auth, which I'm pretty sure is the right URL to use.

    Any ideas how I can fix this or how to make it work again?

    Mine has started working again after a reboot of the server. Now it does not because I can not connect. It seems that I forgot the password (unlikely, but possible if she forced me to change) and the only way to reset the password is to have a support agreement valid for the Analyzer software is used on the router. Which is not currently the case on this particular router as it ages.

  • Update of applications does not ask for password

    Hello

    I put my settings to use one password to update apps on my iPhone 5, but since I have not upgraded to iOS 10 none appearing guest to enter the password when I hit the button to update for any application.

    Please think about if I'm missing all parameters

    Thank you

    I don't think that a password has already had to update the app store applications that are already installed on your device. Just enter a password when you download an app for the first time.

  • Analysis application does not work for HP Officejet 6500 has more.

    My OS is Windows Vista 64-bit. Image of Windows service is not running. I followed the steps to start the dependency services. Still will not start. Error message 1068.     Any suggestions?

    Hello FixN

    Try the following steps to ensure that all services are running. RPC end point mapper may not show it seems have found under Windows 7 but not Vista. You are using Vista as the original poster?

    1. type services.msc in run or search and files program
    2. scroll the page up to the WIA Windows Image Acquisition
    3. make sure that the service is running. Click on stop and then restart to ensure
    4 restart the computer
     
    Restart the services of dependencies:
    1. Click Start, in the search box type "services" without the quotes.
    2. scroll down until you see Windows Image Acquisition (WIA).
    3. double click on it and go to the Dependencies tab.
    4-2 services must be listed.
    5. close this window and look for the remote procedure call (RPC).
    6. make sure it's on manual or if it is enabled automatically, just leave it. Make sure the service is started.
    7. go to hardware detection kernel and Double click.
    8. set the Startup Type to manual and click on apply.
    9. you should be able to start the service by pressing Start.
    10 now, you are done and the Twain Manager must work and gives you is not a mistake.
     
    Check the dependencies or sous-dependances:
     
    Right-click WIA (Windows Image Acquisition) by selecting the first properties, and then click the Dependencies tab. It should list: remote procedure call and detection of Harward Shell
     
    Under the CPP he then list Launcher process for the Service DCOM and RPC Endpoint Mapper to go back to the main list services.msc and then right click, will launch all the items listed as dependencies or void dependencies under WIA

  • Download is successful, but the application does not work for install

    Hello

    I downloaded the application install Adobe Reader DC, it's in my downloads folder and I can save it in different places but when I click or double click nothing happens. I tried to run as an administrator (even if I'm already the admin for this machine) and I get the same result. There is no error message, so I have no idea what is the problem.

    I use Windows 8.1, Google Chrome. Any suggestions gratefully appreciated!

    Thank you

    KS

    Try using Setup http://get.adobe.com/reader/enterprise/ offline

  • My application does not work for two days after the update

    ITI has been two days now my app is not workog knowing that I paid for a membership year after that I did the update it please help

    We will post updates on the installation of revel problem in the following thread:

    Problem installing Adobe Revel 2.3.2

  • Sqlplus does not wait for the end of the string

    If we want to just exit
    Hello
    World

    Then
    Select ' Hello
    World ' double.

    If the desired output is
    Hello;
    World;

    Select ' Hello;
    World;' double.

    Gives an error and we have to do this, select 'Hello '; Chr (10) | ' World;' double.

    Is this a feature?

    Hello

    pleleu wrote:
    ... Is this a feature?

    Depending on what you count as a "feature".
    If a function is defined as a bug they are never going to set, then probably.

    The problem is with the semicolon at the end of the line. If you can contrive to get something after the semicolon, the problem doesn't occur.
    Here's a way to do it:

    SELECT  'Hello;' || '
    World;'  FROM dual;
    
  • I have iphone 5 c. I've updated new version 10.0.2. Now Weather app is working for different cities but does not not for my site which has already been demonstrated in latitude and longitude. Similarly maps application also does not work for my site

    I have iphone 5 c. I've updated new version 10.0.2. Now Weather app is working for different cities but does not not for my site which has already been demonstrated in latitude and longitude. Similarly maps application does not also work for my site.

    Settings > privacy > location Services > confirm you always give permission to these applications to use your location.

    If not, try these standard troubleshooting steps.

    -Reset: hold the Home and Power buttons until you see the logo Apple (10-15 seconds).

    -Restore your iDevice: https://support.apple.com/en-us/HT204184

    If your backup is in iTunes, make sure that it is encrypted.

  • Can I allow an application for one person on my family share but does not allow for each other?

    Can I allow an application for one person on my family share but does not allow for each other?

    You can't delegate who has access and who doesn't have access to the applications. You can lock devices with age restrictions, so only items appropriate age are at their disposal. Or you can hide your list purchases. The purchased app can then be displayed when you want to share with someone else, then be hidden again once the application is downloaded on their device.

    I hope this helps.

    SI10

  • I want to uninstall the application, because it does not stay charged and want more on my computer and not perform the steps for removing it, but none does not work for me.

    I want to uninstall the application, because it does not stay charged and want more on my computer and not perform the steps for removing it, but none does not work for me.

    Cancel see answer #1 in https://forums.adobe.com/thread/2023066 - includes a link to Chat from Monday to Friday

    Sign out of your account... Uninstall... to run vacuuming...

    -http://helpx.adobe.com/creative-cloud/help/install-apps.html (and uninstall)

    -https://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

Maybe you are looking for