On 08/22/2012 08:49 AM, Muthu Subramanian K wrote:
On 08/20/2012 05:00 PM, Michael Meeks wrote:I -imagine- that UX wise, enabling bluetooth during a pairing flow, and> One issue is powering up bluetooth on Android: documentation insists> that you ask the user to switch on bluetooth: one option is to add an > item "Search for Bluetooth" devices on the selection screen which does > this, or alternatively to just ask the user every single time the app> is started.disabling it again if we don't connect is perhaps the best plan from a UX& battery perspective ?Yes, as far as I know, you have to ask the user to turn on Bluetooth. You could create an Intent to show the Settings page for the user to do it.On the battery side: powering the radio down or going to lower power modes is handled by the lower stack, at least for the first round we shouldn't be too concerned about this, I guess (?)
It isn't strictly necessary to ask the user -- there is a BluetoothAdapter.enable() method which controls the power, without asking the user, although the documentation says that shouldn't be used without asking. It would however be possible to ask the user every time the app is started "Switch on Bluetooth to find Bluetooth devices?" along with a "Don't ask again" option to make that permanent? (And then the app can remember whether bluetooth was on beforehand, and switch it off again if necessary.)
(In my experience having bluetooth on doesn't cause considerable drain unless discoverable, so it seems like low power modes are automatic.)
Cheers, Andrzej