Creating an Android library package, including an external (Native or Java) package

I developed an application for computer vision algorithms that uses the Native C++ library, such as OpenCV , to capture the camera frame and process images. My whole implementation is in a native function called by an action.

Say:

 public native int MYMETHOD(int width, int height,int[] rgba); 

I also load my library as follows:

 static { System.loadLibrary("MYNativeLIB"); } 

Now my question is how can I deploy my application as a library package. Something is supplied that I can share it, and clients can import it into their project without installing any other libraries such as OpenCV . Do I need to build a .so package? I read this article . But I do not know how I can link to the OpenCV . Thank you for your help.

+7
android opencv native shared-libraries static-libraries
source share
3 answers

You should take a look at static initialization for OpenCV4andorid . You can then add Open CV lib to the / libs directory of your library project without having to install a third-party application when using it.

+1
source share

Have you created your project as a library? Perhaps you could easily create a new project and port code. A very brief but detailed explanation here :.

http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject

+1
source share

First you need to compile c / C ++ files using android-ndk explanation here

http://rathodpratik.wordpress.com/2013/03/24/build-cc-executables-for-android-using-ndk/

Then you can successfully launch your Android project.

+1
source share

All Articles