Android13 support) Bluetooth MIDI pairing issue

Permission changes in Android 12 are modified and operated by myself according to Google’s documentation.
However, there was another big change in Android 13.

  • Pairing cannot be canceled even if BLE MIDI is disconnected.(I think it’s a specification change because it’s the same as iOS16/macOS13)
  • The pairing dialog (made by JUCE) only lists devices that are (advertised / not advertised), so devices that are already paired and not associated with MIDI cannot be listed.Behavior is different from the iOS/macOS version.

I’m trying to find the paired device on my own and list it in the dialog, but so far it’s not working.
please help.

1 Like

I understand a little why Android 13 is having trouble.
juce/modules/juce_audio_devices/native/java/app/com/rmsl/juce/JuceMidiSupport.java
I tried building with the “-Xlint: deprecation” option,
(gradle’s compileSdkVersion is 31)

C:\Users\ogawa\Documents\GitHub\ToneRoom_main\juce\modules\juce_audio_devices\native\javacore\app\com\rmsl\juce\JuceMidiSupport.java:105: WARNING: [deprecation] BluetoothAdapter’s getDefaultAdapter() is deprecated not
BluetoothDevice btDevice = BluetoothAdapter.getDefaultAdapter ().getRemoteDevice (address);

there was an explanation here

This method was deprecated in API level 31.
this method will continue to work, but developers are strongly encouraged to migrate to using BluetoothManager#getAdapter(), since that approach enables support for Context#createAttributionContext.

It seems that deprecated functions are affecting it, so I think it is necessary to rewrite it to something suitable for API31.

add. Bad news, in MidiSupport.java
android.bluetooth.BluetoothManager
There is a static class whose name conflicts with

BluetoothAdapter.getDefaultAdapter()
=>
appContext.getSystemService(android.bluetooth.BluetoothManager.class).getAdapter()

modified to Less warnings. But the behavior didn’t change.

Thanks for reporting. We’ve made a few updates to Bluetooth MIDI support on Android.

The app manifest now strongly asserts that Bluetooth is not used to determine the device location:

Deprecated Bluetooth APIs are updated here:

2 Likes

BLE-MIDI does not work properly on Android13 is a problem with Android13, and it seems that a fix program has been released. I don’t have a Pixel yet, so I’ll check it out when I get it. :anger:
https://issuetracker.google.com/issues/246166737


another issue.
These seem to be fixed in the QPR2 release. (for only Google Pixel devices)

Android 13: Unable to disconnect Bluetooth MIDI connection
https://issuetracker.google.com/issues/254101893

Can’t disconnect and communicate with BLE MIDI device.
https://issuetracker.google.com/issues/246412046

【BLE MIDI】Can’t send a long SysEx Message
https://issuetracker.google.com/issues/246412047

Can’t connect a BLE MIDI device after rebooting an app
https://issuetracker.google.com/issues/234561550