Bluetooth radio ON/OFF status
Is there any API for checking the Bluetooth radio ON/OFF status? or any API for enable the bluetooth?
I am developing a bluetooth application with auto start on device startup feature. My application will try to open connection with the first paired BT device @ start-up. But the BT open activity was failed due to Bluetooth radio is OFF at the start-up.
But , if i use the API javax.bluetooth.DiscoveryAgent.startInquiry(), the device is asking to enable the bluetooth. So there may be an API retrieving the bluetooth status.
You can get the BT radio status, but the best you can do is to get the system to ask the user to enable BT as you have seen. There doesn't seem to be any way to turn the BT radio on without user action, probably for security.
Thank you for your quick reply.
could you please tell me how can we get the status?
Actually the BT radio was turned on before the device going to soft reset/hard reset. So the device will turn on the BT radio automatically after the reset. but my application is trying to open the BT connection before the BT radio was turned on by the starting process.
Ah ok see your need. I'm away from my code base and can't remember if I use an API call, or a connection failure to find out if the radio is off but have a look at:
The documentation is kind of thin, but the name is promising.
Thank you... i can get the status with javax.bluetooth.LocalDevice.isPowerOn().
But How can we instruct the blackberry device to Turn ON the bluetooth radio?
Currently i found that, if the BT radio is turned off and user make a call on javax.bluetooth.DiscoveryAgen.StartInquiry(), the Blackberry will POP -up a message " The Application name requires bluetooth to be enabled. Enable Bluetooth? yes | No.
Actually i am searching for a function to do the same. ( i don't want to search the bluetooth devices in range... coz i already have paired devices:smileymad: )
I don't think there is a way for a third party app to turn Bluetooth on. The best you can do is call StartINquiry() and hope the user will agree to turn it on. Bluetooth is a suspect technology in the Blackberry world, there are lots of ways it has been used to attack mobile phones.
by the way Is there any method to get the Bluetooth radio ON/OFF status in OS V 4.0.2?
I have tried to make an API call
It will thrown an exception if the BT is turned off and working in some models with OS v up to 4.2.
But it will not thrown an exception even if the BT was turned OFF in BB perl with OS v 4.2.1 :shock:
Any other useful method?
You have a 4.0 device? I only go back to 4.1, sorry.
ok. I think javax.bluetooth has been introduced from v4.2.1.
So i need to take care it without this. it would be helpful if u could have a solution for this in 4.1 os.
thank you .
|All times are GMT -5. The time now is 01:54 PM.|
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.