Programmatically connect to paired Bluetooth speaker and play audio
In our app, I'd like to connect to a previously paired A2DP Bluetooth Speaker and direct audio playback to it, using Android v4.2 or later. I can successfully create an A2DP profile object using this code to start the process: /* Manifest permissions */ <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> // Get the default adapter BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // Establish connection to the proxy. mBluetoothAdapter.getProfileProxy(this, mProfileListener, BluetoothProfile