Your cpp library should be built with NDK toolchain as "libyourname.a"
to begin with. You don't need Android.mk
for that, even though in many cases deriving a standards-compliant Android.mk
is trivial, and makes the developer's life happier in the long run (See, e.g., github).
The next step should be to prepare a JNI wrapper dynamic library (shared object, .so
), which can be loaded from your Java app. That "libyourname_jni.so"
will probably have its own, separate Android.mk
file. Well, Java is not a must: you can use NativeActivity, or maybe some alternative frameworks.
I suggest the following reading to understand the whole process: http://thesoftwarerogue.blogspot.co.il/2010/05/porting-of-libcurl-to-android-os-using.html