You do not need to do this.  The Android or iOS operating system will do this for you.  There is a misconception that mobile applications should have a “Bluetooth button” to enable or disable Bluetooth.  If a Bluetooth device is connected, such a button could switch between the Bluetooth device and the internal speaker.  This feature does not work well in practice, and it opens the possibility that the user will connect a Bluetooth device and it will not work as expected because application support is switched off.  It seems more intuitive to have application support enabled all the time so that Bluetooth will be used if a device is connected.  With this design, the “Bluetooth button” is the system menu that anyone using Bluetooth devices should already be familiar with.

Both Android and iOS have APIs that tell the OS how audio is expected to work.  Android has the AudioManager, and iOS has AVAudioSession.  Both have options to enable Bluetooth support, but these options do not actually control the audio route.  Specifying Bluetooth support does not mean that audio will always use Bluetooth, it means that if a Bluetooth device is connected the OS will try to use it.  The following code snippets show how to enable Bluetooth support using Xamarin, a C# wrapper for Android and iOS applications:


using Android.Media;


void EnableBluetoothSupport()


    audio = (AudioManager)



    audio.Mode = Mode.InCommunication;

    audio.BluetoothScoOn = true;




using AVFoundation;


void EnableBluetoothSupport()


    NSError err;




        out err);