libremidi icon indicating copy to clipboard operation
libremidi copied to clipboard

Android support?

Open AlGrenadine opened this issue 6 years ago • 12 comments

Title says it all :)

AlGrenadine avatar Jan 03 '20 20:01 AlGrenadine

hello ! that would be nice - I would expect that it "just works" on android as Android uses ALSA behind the scene if I'm not mistaken but I do not knjow at all on iOS - is it not CoreMidi there too ?

jcelerier avatar Jan 04 '20 19:01 jcelerier

Yes coremidi seems to work on iOS but alsa doesn't on Android afaik

AlGrenadine avatar Jan 04 '20 19:01 AlGrenadine

damn I hope we don't have to call Java APIs to make it work

jcelerier avatar Jan 04 '20 19:01 jcelerier

I fear you have to :(

AlGrenadine avatar Jan 04 '20 19:01 AlGrenadine

just checked and apparently no ! android NDK comes with a C/C++ midi API:

https://developer.android.com/ndk/reference/group/midi

jcelerier avatar Jan 18 '21 12:01 jcelerier

In case it matters, Android Native MIDI API is available only in Android 10 or later.

atsushieno avatar Feb 01 '21 16:02 atsushieno

argh :) communicating through JNI is an... exercice in patience to say the least (and I have very few experience with it). I'd be ok with trying to do it with the more recent API, then if someone wants to contribute support for the java-based API it'll be 100 % welcome but I don't have the courage for it

jcelerier avatar Feb 01 '21 17:02 jcelerier

50% done, I could make the library build for iOS, there were a couple minor things.

jcelerier avatar May 14 '21 19:05 jcelerier

the code that seems required for android is .... yuck yuck yuck

https://github.com/thestk/rtmidi/blob/master/RtMidi.cpp#L4838

jcelerier avatar Feb 07 '24 19:02 jcelerier

the code that seems required for android is .... yuck yuck yuck

https://github.com/thestk/rtmidi/blob/master/RtMidi.cpp#L4838

Excellent :)

AlGrenadine avatar Feb 07 '24 19:02 AlGrenadine

https://github.com/android/ndk-samples/blob/main/native-midi/app/src/main/cpp/AppMidiManager.cpp

definitely not ahah, I'd rather like to avoid having some weird JNI calls and Java object discovery in the middle. Maybe it can be part of some example though - the end-user would be able to implement these calls however they see fit.

jcelerier avatar Feb 07 '24 19:02 jcelerier

Anyway, now it's implemented in rtmidi it's still good news :)

AlGrenadine avatar Feb 07 '24 19:02 AlGrenadine