I'm trying to develop a midlet that will continuously inquiry for nearby devices. I want to test if it's possible to inquiry a device while he is inquiring too.
I have done this continuous inquiry by doing an initial startInquiry and then calling the startInquiry again inside the inquiryCompleted event handler.
After this i encountered two problems. The first was in the mobile emulator. The first inquiry doesn't give an error, but after that i get "BluetoothStateException: The previous device discovery is running".
When i try this in the actual device (my personal cellphone) it doesn't throw an exception but it doesn't do anything else. It blocks on the startInquiry (the second one) and does nothing. The interface continues to work (since it blocked the thread of the event handler, i think).
I've tried several solutions like calling cancelInquiry before the new startInquiry. I tried also (at least on the emulator) to put a delay before calling the next startInquiry.
How do i do this?
July 9, 2008 9:49 AM
April 22, 2009 9:22 PM