I have OpenCV code (c++), which I want to use in Android. To do this I have to use Android NDK. I downloaded OpenCV package for Android development (ver. 2.4.0) and did all
Whoohoo!
Finally I found solution for this problem by myself!
I decided to debug line:
System.loadLibrary("native_sample");
To do this I downloaded android source code from Android-SDK and then attached source folder (/opt/android-sdk-linux/sources/android-15) to my project. After this I found that error was:
Cannot load library: link_image[1936]: 37 could not load needed library 'libopencv_java.so' for 'libhello-jni.so' (load_library[1091]: Library 'libopencv_java.so' not found)
And really this library is not in lib directory. I don't know why but ndk-build ignored it. So i decided to copy and load it manualy. For this I copied libopencv_java.so from /opt/OpenCV-2.4.0/libs/armeabi-v7a and also edited java code:
static {
System.loadLibrary("opencv_java"); //load opencv_java lib
System.loadLibrary("native_sample");
}
Actually similar problems are:
From second solution I found that I can load libraries using dlopen, but I haven't tried it yet.
So I will write simple bash-script that will do it (just copy) for myself.
Thanks to all.