I am checking whether Bluetooth is on or not using the following method;
while (!isOn) {
isOn = LocalDevice.isPowerOn();
if (isOn) {
startProcess();
break;
}
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
But, I think this will eat the phone resources. I am looking for some listener kind of thing (like BroadcastReceivers in Android) which will notify me when the user turns on the Bluetooth. I've already googled it and also searched the BlackBerry Community Forum, but didn't find any solution. It will be great if anybody of you guides me in the right direction.
My development environment;
- BlackBerry JDE Eclipse Plugin 1.5.0
- Targeting BlackBerry JRE 5.0