Hi JUCE Forum,
I have an application which opens midi ports to one or more class compliant midi devices which is functional on both macOS and iOS.
However, when I run the application on android, the MidiInput::getDevices()
function returns an empty StringArray list, when I know for a fact that there is a midi device connected via usb (Android system debugging shows the UsbHostManager recognising the device).
When I stepped through the code, I reached the getDevices()
function in juce_android_Midi.cpp, where the deviceManager.get()
function does not return a valid object.
juce_android_Midi.cpp line 185 onwards :
if (jobject dm = deviceManager.get()) //DOES NOT RETURN TRUE HERE
{
jobjectArray jDevices
= (jobjectArray) getEnv()->CallObjectMethod (dm, input ? MidiDeviceManager.getJuceAndroidMidiInputDevices
: MidiDeviceManager.getJuceAndroidMidiOutputDevices);
// Create a local reference as converting this
// to a JUCE string will call into JNI
LocalRef<jobjectArray> devices (jDevices);
return javaStringArrayToJuce (devices);
}
Am I missing something about detecting midi devices on Android, i.e. does anything extra have to be done apart from calling MidiInput::getDevices()
?
Thanks in advance for the help, any thoughts are greatly appreciated