Creating Android library package including external (Native or Java) package
I have developed an application for computer vision algorithms that uses Native C++
library like OpenCV
to capture camera frame and do image processing. My whole implementation resides in a native function which is called through an activity.
Let's say:
public native int MYMETHOD(int width, int height,int[] rgba);
I also load my library like this:
static {
System.loadLibrary("MYNativeLIB");
}
Now my question is how can I deploy my application as a library package. Something deliverable that I can share it and the clients can import it to their project without installing any other libraries like OpenCV
. Do I need to build a .so
package? I have read this article. But I do not know how can I link against OpenCV
library as well. Thanks for your help in advance.
You should have a look at the static initialization for OpenCV4andorid. You then can add the Open CV lib into your /libs directory of your Library project without the need to install any third party app when using it.
Have you created your project as a library? Maybe you could create a new project and port code with little effort. A very concise yet detailed explanation here:.
http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject
First you need to compile c/c++ files using android-ndk detailed explanation here
http://rathodpratik.wordpress.com/2013/03/24/build-cc-executables-for-android-using-ndk/
Then you can successfully run your android project.
链接地址: http://www.djcxy.com/p/19472.html上一篇: VS2013中的表单设计师放大?