How to enable/disable bluetooth programmatically in android -


Hi all,

I want to enable / disable Bluetooth via the program. Pass the following code.

  Bluetooth adapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter (); If (! MBluetoothAdapter.isEnabled ()) {Intent EnableBitIntent = New Intent (BluetoothAdapter.ACTION_REQUEST_ENABLE); StartActivityForResult (enableBtIntent, REQUEST_ENABLE_BT);  

But this type of code is not working in SDK 1.5. How can I do this in SDK 1.5?

You can try to use the backport of the Bluetooth API (not trying to do it personally):


Comments