Ask Your Question
2

How the libopencv_java.so is copy to the apk when it is used the static lib type?

asked 2012-07-30 07:16:34 -0600

Weblucas gravatar image

updated 2012-07-31 02:32:21 -0600

Andrey Pavlenko gravatar image

I compile the jni part of my code, the camera libs ares copied, but the libopencv_java.so is ways missing. I do this copy by hand then everthing works...

my android.mk

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=STATIC
include ../includeOpenCV.mk
include $(OPENCV_MK_PATH)

LOCAL_MODULE    := olah
LOCAL_CFLAGS    := -Werror
LOCAL_SRC_FILES := part_jni.cpp 
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../../libs/
LOCAL_LDLIBS    += -llog -ldl -lGLESv2

include $(BUILD_SHARED_LIBRARY)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2012-07-31 02:43:59 -0600

Andrey Pavlenko gravatar image

When you use static OpenCV linking via

OPENCV_LIB_TYPE:=STATIC

You don't need libopencv_java.so: the OpenCV code is embedded into your jni library via "*.a" files from the OpenCV SDK (look into OpenCV-2.4.2-android-sdk/sdk/native/libs/armeabi-v7a/ content). This approach increases your APK size (in worst case you'll have to keep 3 copies of OpenCV code for armeabi, armeabi-v7a and x86).
We recommend use of OpenCV Manager instead to share the same OpenCV binaries across all app-s (slides, tutorial).

edit flag offensive delete link more
0

answered 2012-12-14 03:05:39 -0600

V.G. gravatar image

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-07-30 07:16:34 -0600

Seen: 4,879 times

Last updated: Dec 14 '12