billthefarmer / mididriver

Android midi driver using Sonivox EAS library
176 stars 52 forks source link

How to compile to libmidi.so? #3

Closed JohnnySung closed 10 years ago

JohnnySung commented 10 years ago

Very good and useful source code. I like to study more details.

The source code mididriver-master has 4 libraries libmidi.so; I think they are compiled from platform_external_sonivox_master. Since I have no experience in Android NDK, I don't know how to compile to libraries. Can you tell me how to, as the way google did, in google ndk example 'Exploring the hello-jni Sample' in http://developer.android.com/tools/sdk/ndk/index.html? I cannot find build.xml in the files.

billthefarmer commented 10 years ago

The compilation instructions are here: http://developer.android.com/tools/sdk/ndk/index.html#GetStarted. I have an Android.mk file in the jni floder with the instructions to buil the libmidi.so shared library.

LOCAL_MODULE := midi LOCAL_SRC_FILES := midi.c

for EAS midi

LOCAL_LDLIBS += -lsonivox

The rest of the file is from a template.

Get a copy of libsonivox.so from your device or an emulator and put it with the other shared libraries in the NDK. Where you put it depends on which version of Android you are building for. You don't need the sources from platform_external_sonivox_master. You don't need to get the include files either because they are in the jni folder. Then you can build it. Most of this is in the README.

JohnnySung commented 9 years ago

Thanks for your answer, and apologize not understanding how to use GitHub to get your notifications, till now I found it.

I already used you .so files to built my app in https://play.google.com/store/apps/details?id=com.johnny.classicalhymnsfree.

However I still cannot compile .so files by myself, when I load new project from platform_external_sonivox downloaded project, I cannot click "finish"....Anyway it is not important for me now.

Thank you! Johnny Sung