-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Android support to rtmidi #315
Conversation
Using the correct Android flag
OMG, i really really need this. Why this was not mergerd yet? |
Looks like other pull requests were merged before mine and there are merge conflicts. The build failures have nothing to do with this pull request though. |
@garyscavone Can you try to merge it again? |
Can you revise it to put the ANDROID enum at the end of the list? That is what we have been doing with new APIs. |
Sure, done. |
@garyscavone I updated (and aligned) the enums. |
You guys rock |
This is the Android support for rtmidi. I tested the implementation using the rtmidi API and confirmed it works.
One caveat is that the single Java class in contrib/java must be included in the final Android application. That class is instantiated and managed by the C++ code but unfortunately it is required by the Android Midi API. Otherwise an Android app should use the regular rtmidi API, no need to deal with Java at all.
The command below is an example on how to build rtmidi with Android support. It targets the SDK API level 32 and generates arm64 binaries.
cmake .. -B arm64 --toolchain <android sdk>/ndk/<ndk version>/build/cmake/android.toolchain.cmake -DANDROID_NDK=<android sdk>/ndk/<ndk version> -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-32 -DANDROID=32 -DANDROID_STL=c++_shared -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=FALSE