I have a small project I've coded for Android that uses a small about of NDK/JNI code. I'd like to share this code between two projects but I'm having little luck so far. First off, I've tried to refactor off the NDK specific code into a library which I think link to both projects using
'project->java build path->source->link source'
and specifying the native library in there. Sounds good but it's wrong. The project from which I refactored the code still requires the .so library file in
MyOriginalProject\libs\armeabi\MyNativeLibrary.so
Removing that from the original project whilst still linking the source of the refactored library fails.
Secondly, creating a new project and attempting to use the NDK library I wrote by both including the source of the library and copying over the .so files from 'obj' and 'libs' into the root directory of the new project fails. It seems to pass
System.loadLibrary("MyNativeLibrary")
At least, it didn't assert.
The code gets as far as my first NDK call and then crashes without being caught by my exception handler.
Any hints would be welcome - such as foolproof ways to get NDK to load a library, typical gotchas and NDK debugging techniques.
Thanks in advance,
Tim.